pub trait Uniform {
    // Required method
    fn generate<R>(rng: &mut R) -> Self
       where R: RngCore + CryptoRng;

    // Provided method
    fn generate_for_testing() -> Self
       where Self: Sized { ... }
}
Expand description

A type family for schemes which know how to generate key material from a cryptographically-secure CryptoRng.

Required Methods§

source

fn generate<R>(rng: &mut R) -> Selfwhere R: RngCore + CryptoRng,

Generate key material from an RNG. This should generally not be used for production purposes even with a good source of randomness. When possible use hardware crypto to generate and store private keys.

Provided Methods§

source

fn generate_for_testing() -> Selfwhere Self: Sized,

Generate a random key using the shared TEST_SEED

Implementations on Foreign Types§

source§

impl<S, P> Uniform for (S, P)where S: Uniform, for<'a> P: From<&'a S>,

A pair consisting of a private and public key

source§

fn generate<R>(rng: &mut R) -> Selfwhere R: RngCore + CryptoRng,

Implementors§