pub struct SigningTranscriptWithRng<T, R>where
    T: SigningTranscript,
    R: RngCore + CryptoRng,{ /* private fields */ }
Expand description

Schnorr signing transcript with the default ThreadRng replaced by an arbitrary CryptoRng.

If ThreadRng breaks on your platform, or merely if your paranoid, then you might “upgrade” from ThreadRng to OsRng by using calls like keypair.sign( attach_rng(t,OSRng::new()) ). We recommend instead simply fixing ThreadRng for your platform however.

There are also derandomization tricks like attach_rng(t,ChaChaRng::from_seed([0u8; 32])) for deterministic signing in tests too. Although derandomization produces secure signatures, we recommend against doing this in production because we implement protocols like multi-signatures which likely become vulnerabile when derandomized.

Trait Implementations§

source§

impl<T, R> SigningTranscript for SigningTranscriptWithRng<T, R>where T: SigningTranscript, R: RngCore + CryptoRng,

source§

fn commit_bytes(&mut self, label: &'static [u8], bytes: &[u8])

Extend transcript with some bytes, shadowed by merlin::Transcript.
source§

fn challenge_bytes(&mut self, label: &'static [u8], dest: &mut [u8])

Produce some challenge bytes, shadowed by merlin::Transcript.
source§

fn witness_bytes( &self, label: &'static [u8], dest: &mut [u8], nonce_seeds: &[&[u8]] )

Produce secret witness bytes from the protocol transcript and any “nonce seeds” kept with the secret keys.
source§

fn witness_bytes_rng<RR>( &self, label: &'static [u8], dest: &mut [u8], nonce_seeds: &[&[u8]], rng: RR )where RR: RngCore + CryptoRng,

Produce secret witness bytes from the protocol transcript and any “nonce seeds” kept with the secret keys.
source§

fn proto_name(&mut self, label: &'static [u8])

Extend transcript with a protocol name
source§

fn commit_point( &mut self, label: &'static [u8], compressed: &CompressedRistretto )

Extend the transcript with a compressed Ristretto point
source§

fn challenge_scalar(&mut self, label: &'static [u8]) -> Scalar

Produce the public challenge scalar e.
source§

fn witness_scalar(&self, label: &'static [u8], nonce_seeds: &[&[u8]]) -> Scalar

Produce a secret witness scalar k, aka nonce, from the protocol transcript and any “nonce seeds” kept with the secret keys.

Auto Trait Implementations§

§

impl<T, R> !RefUnwindSafe for SigningTranscriptWithRng<T, R>

§

impl<T, R> Send for SigningTranscriptWithRng<T, R>where R: Send, T: Send,

§

impl<T, R> !Sync for SigningTranscriptWithRng<T, R>

§

impl<T, R> Unpin for SigningTranscriptWithRng<T, R>where R: Unpin, T: Unpin,

§

impl<T, R> UnwindSafe for SigningTranscriptWithRng<T, R>where R: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> VRFSigningTranscript for Twhere T: SigningTranscript,

§

type T = T

Real underlying SigningTranscript
source§

fn transcript_with_malleability_addressed(self, publickey: &PublicKey) -> T

Return the underlying SigningTranscript after addressing VRF output malleability, usually by making it non-malleable,
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V