pub struct SigningTranscriptWithRng<T, R>{ /* 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 you’re paranoid,
then you might “upgrade” from ThreadRng to OsRng by using calls
like keypair.sign( attach_rng(t,OSRng::new()) ).
However, we recommend instead simply fixing ThreadRng for your platform.
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 vulnerable when derandomized.
Trait Implementations§
Source§impl<T, R> SigningTranscript for SigningTranscriptWithRng<T, R>
impl<T, R> SigningTranscript for SigningTranscriptWithRng<T, R>
Source§fn commit_bytes(&mut self, label: &'static [u8], bytes: &[u8])
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])
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]],
)
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,
)
fn witness_bytes_rng<RR>( &self, label: &'static [u8], dest: &mut [u8], nonce_seeds: &[&[u8]], rng: RR, )
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])
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,
)
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
fn challenge_scalar(&mut self, label: &'static [u8]) -> Scalar
Produce the public challenge scalar
e.Auto Trait Implementations§
impl<T, R> !Freeze for SigningTranscriptWithRng<T, R>
impl<T, R> !RefUnwindSafe for SigningTranscriptWithRng<T, R>
impl<T, R> Send for SigningTranscriptWithRng<T, R>
impl<T, R> !Sync for SigningTranscriptWithRng<T, R>
impl<T, R> Unpin for SigningTranscriptWithRng<T, R>
impl<T, R> UnwindSafe for SigningTranscriptWithRng<T, R>where
T: UnwindSafe,
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more