re-factor the SHA sigma functions