Struct secp256kfun::nonce::Synthetic [−][src]
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]
fn add_application_tag(self, tag: &str) -> Self
[src]
fn add_protocol_tag(self, tag: &str) -> Self
[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]
H: Tagged + Digest<OutputSize = U32> + Clone,
R: NonceRng,
type Hash = H
The type of hash that begin_derivation
will return.
fn begin_derivation(&self, secret: &Scalar) -> Self::Hash
[src]
Auto Trait Implementations
impl<H, R> RefUnwindSafe for Synthetic<H, R> where
H: RefUnwindSafe,
R: RefUnwindSafe,
H: RefUnwindSafe,
R: RefUnwindSafe,
impl<H, R> Send for Synthetic<H, R> where
H: Send,
R: Send,
H: Send,
R: Send,
impl<H, R> Sync for Synthetic<H, R> where
H: Sync,
R: Sync,
H: Sync,
R: Sync,
impl<H, R> Unpin for Synthetic<H, R> where
H: Unpin,
R: Unpin,
H: Unpin,
R: Unpin,
impl<H, R> UnwindSafe for Synthetic<H, R> where
H: UnwindSafe,
R: UnwindSafe,
H: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Mark for T
[src]
#[must_use]pub fn mark<M>(Self) -> <M as ChangeMark<T>>::Out where
M: ChangeMark<T>,
[src]
M: ChangeMark<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,