@@ -17,7 +17,7 @@ pub fn keygen() -> (IdSecret, Fr) {
1717 let identity_secret = IdSecret :: rand ( & mut rng) ;
1818 let mut to_hash = [ * identity_secret. clone ( ) ] ;
1919 let id_commitment = poseidon_hash ( & to_hash) ;
20- to_hash[ 0 ] . zeroize ( ) ;
20+ to_hash[ 0 ] . zeroize ( ) ; // wipe the identity secret copy from the stack buffer
2121 ( identity_secret, id_commitment)
2222}
2323
@@ -33,7 +33,7 @@ pub fn extended_keygen() -> (Fr, Fr, Fr, Fr) {
3333 let identity_secret = poseidon_hash_pair ( identity_trapdoor, identity_nullifier) ;
3434 let mut to_hash = [ identity_secret] ;
3535 let id_commitment = poseidon_hash ( & to_hash) ;
36- to_hash[ 0 ] . zeroize ( ) ;
36+ to_hash[ 0 ] . zeroize ( ) ; // wipe the identity secret copy from the stack buffer
3737 (
3838 identity_trapdoor,
3939 identity_nullifier,
@@ -58,7 +58,7 @@ pub fn seeded_keygen(signal: &[u8]) -> (Fr, Fr) {
5858 let identity_secret = Fr :: rand ( & mut rng) ;
5959 let mut to_hash = [ identity_secret] ;
6060 let id_commitment = poseidon_hash ( & to_hash) ;
61- to_hash[ 0 ] . zeroize ( ) ;
61+ to_hash[ 0 ] . zeroize ( ) ; // wipe the identity secret copy from the stack buffer
6262 ( identity_secret, id_commitment)
6363}
6464
@@ -81,7 +81,7 @@ pub fn extended_seeded_keygen(signal: &[u8]) -> (Fr, Fr, Fr, Fr) {
8181 let identity_secret = poseidon_hash_pair ( identity_trapdoor, identity_nullifier) ;
8282 let mut to_hash = [ identity_secret] ;
8383 let id_commitment = poseidon_hash ( & to_hash) ;
84- to_hash[ 0 ] . zeroize ( ) ;
84+ to_hash[ 0 ] . zeroize ( ) ; // wipe the identity secret copy from the stack buffer
8585 (
8686 identity_trapdoor,
8787 identity_nullifier,
0 commit comments