Struct schnorr_fun::nonce::Synthetic[][src]

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

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

Creates a Synethetic nonce generator from anything that implements NonceRng.

Trait Implementations

Tells the invocant to return a new version of itself modified with the tag. This is to ensure that a NonceGen does not produce the same outputs for two different tags even if they have the same public inputs. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The type of hash that begin_derivation will return.

Takes a secret Scalar and outputs a hash. Before turining this hash into the nonce, you must add a secret input and all the public inputs from the scheme into the hash. So for a signature scheme for example you would add your secret key, the message and the public key. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Returns a new instance of the invocant that will be marked with M. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.