diff --git a/CHANGELOG.md b/CHANGELOG.md index 3363b93..d1f637c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Entries are listed in reverse chronological order. +## 1.1.3 + +* Reverts the change in 1.1.0 to allow owned and borrowed RNGs, which caused a breakage due to a subtle interaction with ownership rules. (The `RngCore` change is retained). + ## 1.1.2 * Disabled KaTeX on `docs.rs` pending proper [support upstream](https://github.com/rust-lang/docs.rs/issues/302). diff --git a/Cargo.toml b/Cargo.toml index 8d33d2d..bab9c09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "curve25519-dalek" -version = "1.1.2" +version = "1.1.3" authors = ["Isis Lovecruft ", "Henry de Valence "] readme = "README.md" diff --git a/src/ristretto.rs b/src/ristretto.rs index a7b0a27..3774c99 100644 --- a/src/ristretto.rs +++ b/src/ristretto.rs @@ -638,7 +638,7 @@ impl RistrettoPoint { /// discrete log of the output point with respect to any other /// point should be unknown. The map is applied twice and the /// results are added, to ensure a uniform distribution. - pub fn random(mut rng: T) -> Self { + pub fn random(rng: &mut R) -> Self { let mut uniform_bytes = [0u8; 64]; rng.fill_bytes(&mut uniform_bytes); diff --git a/src/scalar.rs b/src/scalar.rs index 81a78ee..fcdc196 100644 --- a/src/scalar.rs +++ b/src/scalar.rs @@ -527,7 +527,7 @@ impl Scalar { /// let mut csprng: OsRng = OsRng::new().unwrap(); /// let a: Scalar = Scalar::random(&mut csprng); /// # } - pub fn random(mut rng: T) -> Self { + pub fn random(rng: &mut R) -> Self { let mut scalar_bytes = [0u8; 64]; rng.fill_bytes(&mut scalar_bytes); Scalar::from_bytes_mod_order_wide(&scalar_bytes)