[−][src]Struct schnorr_fun::nonce::Synthetic
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, R> Synthetic<H, R> where
H: Default,
R: NonceRng,
[src]
H: Default,
R: NonceRng,
pub fn new(rng: R) -> Synthetic<H, R>
[src]
Creates a Synethetic
nonce generator from anything that implements NonceRng
.
Trait Implementations
impl<H, R> AddTag for Synthetic<H, R> where
H: Tagged,
[src]
H: Tagged,
fn add_application_tag(self, tag: &str) -> Synthetic<H, R>
[src]
fn add_protocol_tag(self, tag: &str) -> Synthetic<H, R>
[src]
impl<H, R> Clone for Synthetic<H, R> where
H: Clone,
R: Clone,
[src]
H: Clone,
R: Clone,
impl<H, R> Debug for Synthetic<H, R> where
H: Debug,
R: Debug,
[src]
H: Debug,
R: Debug,
impl<H, R> Default for Synthetic<H, R> where
H: Default,
R: Default,
[src]
H: Default,
R: Default,
impl<H, R> NonceGen for Synthetic<H, R> where
H: Tagged + Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>> + Clone,
R: NonceRng,
[src]
H: Tagged + Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>> + Clone,
R: NonceRng,
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,
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]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.
fn to_owned(&self) -> T
[src]
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.
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>,