pub struct Signature<Mode: LmsOtsMode> { /* private fields */ }Expand description
Opaque struct representing a LM-OTS signature
Implementations§
Source§impl<Mode: LmsOtsMode> Signature<Mode>
impl<Mode: LmsOtsMode> Signature<Mode>
Sourcepub fn recover_pubkey(
&self,
id: [u8; 16],
q: u32,
msg: &[u8],
) -> VerifyingKey<Mode>
pub fn recover_pubkey( &self, id: [u8; 16], q: u32, msg: &[u8], ) -> VerifyingKey<Mode>
Returns a public key candidate for this signature as defined by algorithm 4b of the LMS RFC. The signature will always be valid for the returned public key candidate.
Trait Implementations§
Source§impl<Mode: LmsOtsMode> Clone for Signature<Mode>
impl<Mode: LmsOtsMode> Clone for Signature<Mode>
Source§impl<Mode: LmsOtsMode> From<Signature<Mode>> for Output<Mode>
Converts a Signature into its byte representation
impl<Mode: LmsOtsMode> From<Signature<Mode>> for Output<Mode>
Converts a Signature into its byte representation
Source§impl<Mode: LmsOtsMode> PartialEq for Signature<Mode>
impl<Mode: LmsOtsMode> PartialEq for Signature<Mode>
Source§impl<Mode: LmsOtsMode> RandomizedSignerMut<Signature<Mode>> for SigningKey<Mode>
impl<Mode: LmsOtsMode> RandomizedSignerMut<Signature<Mode>> for SigningKey<Mode>
Source§fn try_sign_with_rng(
&mut self,
rng: &mut impl CryptoRngCore,
msg: &[u8],
) -> Result<Signature<Mode>, Error>
fn try_sign_with_rng( &mut self, rng: &mut impl CryptoRngCore, msg: &[u8], ) -> Result<Signature<Mode>, Error>
Attempt to sign the given message, updating the state, and returning a
digital signature on success, or an error if something went wrong. Read more
Source§fn sign_with_rng(&mut self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S
fn sign_with_rng(&mut self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S
Sign the given message, update the state, and return a digital signature.
Source§impl<Mode: LmsOtsMode> SignatureEncoding for Signature<Mode>
impl<Mode: LmsOtsMode> SignatureEncoding for Signature<Mode>
Source§type Repr = GenericArray<u8, <<<Mode as LmsOtsMode>::NLen as Mul<<<Mode as LmsOtsMode>::PLen as Add<UInt<UTerm, B1>>>::Output>>::Output as Add<UInt<UInt<UInt<UTerm, B1>, B0>, B0>>>::Output>
type Repr = GenericArray<u8, <<<Mode as LmsOtsMode>::NLen as Mul<<<Mode as LmsOtsMode>::PLen as Add<UInt<UTerm, B1>>>::Output>>::Output as Add<UInt<UInt<UInt<UTerm, B1>, B0>, B0>>>::Output>
Byte representation of a signature.
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Get the length of this signature when encoded.
Source§impl<'a, Mode: LmsOtsMode> TryFrom<&'a [u8]> for Signature<Mode>
Tries to parse a Signature from an exact slice
impl<'a, Mode: LmsOtsMode> TryFrom<&'a [u8]> for Signature<Mode>
Tries to parse a Signature from an exact slice
Source§impl<Mode: LmsOtsMode> Verifier<Signature<Mode>> for VerifyingKey<Mode>where
<Mode::Hasher as OutputSizeUser>::OutputSize: Add<U2>,
Sum<<Mode::Hasher as OutputSizeUser>::OutputSize, U2>: ArrayLength<u8>,
impl<Mode: LmsOtsMode> Verifier<Signature<Mode>> for VerifyingKey<Mode>where
<Mode::Hasher as OutputSizeUser>::OutputSize: Add<U2>,
Sum<<Mode::Hasher as OutputSizeUser>::OutputSize, U2>: ArrayLength<u8>,
impl<Mode: Eq + LmsOtsMode> Eq for Signature<Mode>
Auto Trait Implementations§
impl<Mode> Freeze for Signature<Mode>where
<<<Mode as LmsOtsMode>::Hasher as OutputSizeUser>::OutputSize as ArrayLength<u8>>::ArrayType: Freeze,
<<Mode as LmsOtsMode>::PLen as ArrayLength<GenericArray<u8, <<Mode as LmsOtsMode>::Hasher as OutputSizeUser>::OutputSize>>>::ArrayType: Freeze,
impl<Mode> RefUnwindSafe for Signature<Mode>where
<<<Mode as LmsOtsMode>::Hasher as OutputSizeUser>::OutputSize as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
<<Mode as LmsOtsMode>::PLen as ArrayLength<GenericArray<u8, <<Mode as LmsOtsMode>::Hasher as OutputSizeUser>::OutputSize>>>::ArrayType: RefUnwindSafe,
impl<Mode> Send for Signature<Mode>
impl<Mode> Sync for Signature<Mode>
impl<Mode> Unpin for Signature<Mode>where
<<<Mode as LmsOtsMode>::Hasher as OutputSizeUser>::OutputSize as ArrayLength<u8>>::ArrayType: Unpin,
<<Mode as LmsOtsMode>::PLen as ArrayLength<GenericArray<u8, <<Mode as LmsOtsMode>::Hasher as OutputSizeUser>::OutputSize>>>::ArrayType: Unpin,
impl<Mode> UnwindSafe for Signature<Mode>where
<<<Mode as LmsOtsMode>::Hasher as OutputSizeUser>::OutputSize as ArrayLength<u8>>::ArrayType: UnwindSafe,
<<Mode as LmsOtsMode>::PLen as ArrayLength<GenericArray<u8, <<Mode as LmsOtsMode>::Hasher as OutputSizeUser>::OutputSize>>>::ArrayType: 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