Skip to main content

RandomizedSignerMut

Trait RandomizedSignerMut 

Source
pub trait RandomizedSignerMut<S> {
    // Required method
    fn try_sign_with_rng<R: TryCryptoRng + ?Sized>(
        &mut self,
        rng: &mut R,
        msg: &[u8],
    ) -> Result<S, Error>;

    // Provided method
    fn sign_with_rng<R: CryptoRng + ?Sized>(
        &mut self,
        rng: &mut R,
        msg: &[u8],
    ) -> S { ... }
}
Expand description

Sign the provided message bytestring using &mut Self (e.g. an evolving cryptographic key such as a stateful hash-based signature), and a per-signature randomizer, returning a digital signature.

Required Methods§

Source

fn try_sign_with_rng<R: TryCryptoRng + ?Sized>( &mut self, rng: &mut R, msg: &[u8], ) -> Result<S, Error>

Attempt to sign the given message, updating the state, and returning a digital signature on success, or an error if something went wrong.

§Errors

Signing can fail, e.g. if the number of time periods allowed by the current key is exceeded, or if the provided rng experiences an internal failure.

Provided Methods§

Source

fn sign_with_rng<R: CryptoRng + ?Sized>(&mut self, rng: &mut R, msg: &[u8]) -> S

Sign the given message, update the state, and return a digital signature.

§Panics

In the event of a signing error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<S, T: RandomizedSigner<S>> RandomizedSignerMut<S> for T

Available on crate feature rand_core only.

Blanket impl of RandomizedSignerMut for all RandomizedSigner types.