Skip to content

Commit

Permalink
Merge branch 'rng_ref' of git://github.com/burdges/curve25519-dalek i…
Browse files Browse the repository at this point in the history
…nto burdges-rng_ref
  • Loading branch information
hdevalence committed Feb 14, 2019
2 parents 63c19c1 + 20fd561 commit 66b38ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ristretto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: RngCore + CryptoRng>(rng: &mut T) -> Self {
pub fn random<T: RngCore + CryptoRng>(mut rng: T) -> Self {
let mut uniform_bytes = [0u8; 64];
rng.fill_bytes(&mut uniform_bytes);

Expand Down
2 changes: 1 addition & 1 deletion src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ impl Scalar {
/// let mut csprng: OsRng = OsRng::new().unwrap();
/// let a: Scalar = Scalar::random(&mut csprng);
/// # }
pub fn random<T: RngCore + CryptoRng>(rng: &mut T) -> Self {
pub fn random<T: RngCore + CryptoRng>(mut rng: T) -> Self {
let mut scalar_bytes = [0u8; 64];
rng.fill_bytes(&mut scalar_bytes);
Scalar::from_bytes_mod_order_wide(&scalar_bytes)
Expand Down

0 comments on commit 66b38ce

Please sign in to comment.