From 91e11b6318a9144b945140d63a8a00266889265a Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Tue, 2 May 2017 21:22:04 -0700 Subject: [PATCH] Change docstring to match the trait bound --- src/scalar.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/scalar.rs b/src/scalar.rs index d711173..2ec4959 100644 --- a/src/scalar.rs +++ b/src/scalar.rs @@ -144,21 +144,19 @@ impl CTAssignable for Scalar { } impl Scalar { - /// Return a `Scalar` chosen uniformly at random using a CSPRNG. - /// Panics if the operating system's CSPRNG is unavailable. + /// Return a `Scalar` chosen uniformly at random using a user-provided RNG. /// /// # Inputs /// - /// * `cspring`: any cryptographically secure PRNG which - /// implements the `rand::Rng` interface. + /// * `rng`: any RNG which implements the `rand::Rng` interface. /// /// # Returns /// /// A random scalar within ℤ/lℤ. #[cfg(feature = "std")] - pub fn random(csprng: &mut T) -> Self { + pub fn random(rng: &mut T) -> Self { let mut scalar_bytes = [0u8; 64]; - csprng.fill_bytes(&mut scalar_bytes); + rng.fill_bytes(&mut scalar_bytes); Scalar::reduce(&scalar_bytes) }