Skip to content

Commit 6307ea9

Browse files
authored
Updating rand_core to 0.6 (without curve25519-dalek library change) (#131)
1 parent e35410a commit 6307ea9

File tree

3 files changed

+82
-21
lines changed

3 files changed

+82
-21
lines changed

Cargo.lock

+75-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ generic-bytes = { version = "0.1.0" }
2525
generic-bytes-derive = { version = "0.1.0" }
2626
hkdf = "0.10.0"
2727
hmac = "0.10.1"
28-
rand_core = "0.5.1"
28+
rand_core = { version = "0.6.0", features = ["getrandom"] }
2929
scrypt = { version = "0.5.0", optional = true }
3030
subtle = { version = "2.3.0", default-features = false }
3131
thiserror = "1.0.22"
@@ -41,7 +41,7 @@ lazy_static = "1.4.0"
4141
serde_json = "1.0.60"
4242
sha2 = "0.9.2"
4343
proptest = "0.10.1"
44-
rand = "0.7"
44+
rand = "0.8"
4545
rustyline = "7.0.0"
4646

4747
[[bench]]

src/group.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ impl Group for RistrettoPoint {
7979
}
8080
fn random_scalar<R: RngCore + CryptoRng>(rng: &mut R) -> Self::Scalar {
8181
#[cfg(not(test))]
82-
return Scalar::random(rng);
82+
{
83+
let mut scalar_bytes = [0u8; 64];
84+
rng.fill_bytes(&mut scalar_bytes);
85+
Scalar::from_bytes_mod_order_wide(&scalar_bytes)
86+
}
8387

8488
// Tests need an exact conversion from bytes to scalar, sampling only 32 bytes from rng
8589
#[cfg(test)]

0 commit comments

Comments
 (0)