Trait Uniform

Source
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) -> Self
where 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() -> Self
where Self: Sized,

Generate a random key using the shared TEST_SEED

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

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) -> Self
where R: RngCore + CryptoRng,

Implementors§