Struct secp256kfun::nonce::Synthetic[][src]

pub struct Synthetic<H, R> { /* fields omitted */ }

A nonce generator that uses an RNG to mix in real randomness into the nonce generation.

The rng needs to implmenet NonceRng. This is done already for GlobalRng.

Examples

use rand::rngs::ThreadRng;
use secp256kfun::nonce;
use sha2::Sha256;
// the usual way to use this.
let nonce_gen = nonce::Synthetic::<Sha256, nonce::GlobalRng<ThreadRng>>::default(); // or OsRng
let nonce_gen = nonce::Synthetic::<Sha256, _>::new(my_rng); // BYO rng you've implemented NonceRng for

Implementations

impl<H: Default, R: NonceRng> Synthetic<H, R>[src]

pub fn new(rng: R) -> Self[src]

Creates a Synethetic nonce generator from anything that implements NonceRng.

Trait Implementations

impl<H: Tagged, R> AddTag for Synthetic<H, R>[src]

impl<H: Clone, R: Clone> Clone for Synthetic<H, R>[src]

impl<H: Debug, R: Debug> Debug for Synthetic<H, R>[src]

impl<H: Default, R: Default> Default for Synthetic<H, R>[src]

impl<H, R> NonceGen for Synthetic<H, R> where
    H: Tagged + Digest<OutputSize = U32> + Clone,
    R: NonceRng
[src]

type Hash = H

The type of hash that begin_derivation will return.

Auto Trait Implementations

impl<H, R> RefUnwindSafe for Synthetic<H, R> where
    H: RefUnwindSafe,
    R: RefUnwindSafe

impl<H, R> Send for Synthetic<H, R> where
    H: Send,
    R: Send

impl<H, R> Sync for Synthetic<H, R> where
    H: Sync,
    R: Sync

impl<H, R> Unpin for Synthetic<H, R> where
    H: Unpin,
    R: Unpin

impl<H, R> UnwindSafe for Synthetic<H, R> where
    H: UnwindSafe,
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Mark for T[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.