Updating rand_core to 0.6 (without curve25519-dalek library change) (#131)

This commit is contained in:
Kevin Lewi
2021-02-05 13:17:35 -08:00
committed by GitHub
parent e35410ab95
commit 6307ea9eed
3 changed files with 82 additions and 21 deletions
+5 -1
View File
@@ -79,7 +79,11 @@ impl Group for RistrettoPoint {
}
fn random_scalar<R: RngCore + CryptoRng>(rng: &mut R) -> Self::Scalar {
#[cfg(not(test))]
return Scalar::random(rng);
{
let mut scalar_bytes = [0u8; 64];
rng.fill_bytes(&mut scalar_bytes);
Scalar::from_bytes_mod_order_wide(&scalar_bytes)
}
// Tests need an exact conversion from bytes to scalar, sampling only 32 bytes from rng
#[cfg(test)]