Trait diem_sdk::crypto::Uniform[][src]

pub trait Uniform {
    fn generate<R>(rng: &mut R) -> Self
    where
        R: RngCore + CryptoRng
; fn generate_for_testing() -> Self { ... } }
Expand description

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

Required methods

fn generate<R>(rng: &mut R) -> Self where
    R: RngCore + CryptoRng
[src]

Expand description

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.

Loading content...

Provided methods

fn generate_for_testing() -> Self[src]

Expand description

Generate a random key using the shared TEST_SEED

Loading content...

Implementations on Foreign Types

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

A pair consisting of a private and public key

pub fn generate<R>(rng: &mut R) -> (S, P) where
    R: RngCore + CryptoRng
[src]

Loading content...

Implementors

impl Uniform for Ed25519PrivateKey[src]

pub fn generate<R>(rng: &mut R) -> Ed25519PrivateKey where
    R: RngCore + CryptoRng
[src]

impl Uniform for MultiEd25519PrivateKey[src]

pub fn generate<R>(rng: &mut R) -> MultiEd25519PrivateKey where
    R: RngCore + CryptoRng
[src]

impl Uniform for PrivateKey[src]

pub fn generate<R>(rng: &mut R) -> PrivateKey where
    R: RngCore + CryptoRng
[src]

impl<S, P> Uniform for KeyPair<S, P> where
    S: Uniform,
    P: for<'a> From<&'a S>, 
[src]

pub fn generate<R>(rng: &mut R) -> KeyPair<S, P> where
    R: RngCore + CryptoRng
[src]

Loading content...