We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Ristretto255::random_scalar()
1 parent 23aa781 commit f3f4fefCopy full SHA for f3f4fef
src/group/ristretto.rs
@@ -96,9 +96,10 @@ impl Group for Ristretto255 {
96
97
fn random_scalar<R: RngCore + CryptoRng>(rng: &mut R) -> Self::Scalar {
98
loop {
99
- let scalar = Scalar::random(rng);
+ let mut scalar_bytes = [0u8; 32];
100
+ rng.fill_bytes(&mut scalar_bytes);
101
- if scalar != Scalar::ZERO {
102
+ if let Ok(scalar) = Self::deserialize_scalar(&scalar_bytes) {
103
break scalar;
104
}
105
0 commit comments