Separate secp256k1_fe_set_int( . , 0 ) from secp256k1_fe_clear()
There are two uses of the secp256k1_fe_clear() function that are now separated
into these two functions in order to reflect the intent:
1) initializing the memory prior to being used -> converted to fe_set_int( . , 0 )
2) zeroing the memory after being used such that no sensitive data remains. ->
remains as fe_clear()
In the latter case, 'magnitude' and 'normalized' need to be overwritten when
VERIFY is enabled.
Co-Authored-By: isle2983 <isle2983@yahoo.com>
This commit is contained in:
committed by
Sebastian Falbesoner
parent
1c08126222
commit
d79a6ccd43
@@ -34,7 +34,7 @@ static void testutil_random_fe_magnitude(secp256k1_fe *fe, int m) {
|
||||
if (n == 0) {
|
||||
return;
|
||||
}
|
||||
secp256k1_fe_clear(&zero);
|
||||
secp256k1_fe_set_int(&zero, 0);
|
||||
secp256k1_fe_negate(&zero, &zero, 0);
|
||||
secp256k1_fe_mul_int_unchecked(&zero, n - 1);
|
||||
secp256k1_fe_add(fe, &zero);
|
||||
|
||||
Reference in New Issue
Block a user