Support passing both borrowed and owned Rngs

This commit is contained in:
Jeff Burdges 2018-12-26 17:09:20 +01:00
parent 7de65dc32c
commit 20fd561482

View file

@ -621,7 +621,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: Rng + CryptoRng>(rng: &mut T) -> Self {
pub fn random<T: Rng + CryptoRng>(mut rng: T) -> Self {
let mut uniform_bytes = [0u8; 64];
rng.fill(&mut uniform_bytes);