[][src]Function rust_elgamal::util::random_scalar

pub fn random_scalar<R: RngCore + CryptoRng>(mut rng: R) -> Scalar

Generate a random scalar from the provided randomness source.

Note: Unfortunately curve25519-dalek uses an old version of rand, so we need to copy its implementation of Scalar::random.

Source: https://github.com/dalek-cryptography/curve25519-dalek/blob/master/src/scalar.rs