pub struct Signature<P: MlDsaParams> { /* private fields */ }
Expand description
An ML-DSA signature
Implementations§
Source§impl<P: MlDsaParams> Signature<P>
impl<P: MlDsaParams> Signature<P>
Sourcepub fn encode(&self) -> EncodedSignature<P>
pub fn encode(&self) -> EncodedSignature<P>
Encode the signature in a fixed-size byte array.
Sourcepub fn decode(enc: &EncodedSignature<P>) -> Option<Self>
pub fn decode(enc: &EncodedSignature<P>) -> Option<Self>
Decode the signature from an appropriately sized byte array.
Trait Implementations§
Source§impl<P> AssociatedAlgorithmIdentifier for Signature<P>
Available on crate feature pkcs8
only.
impl<P> AssociatedAlgorithmIdentifier for Signature<P>
Available on crate feature
pkcs8
only.Source§const ALGORITHM_IDENTIFIER: AlgorithmIdentifierRef<'static> = P::ALGORITHM_IDENTIFIER
const ALGORITHM_IDENTIFIER: AlgorithmIdentifierRef<'static> = P::ALGORITHM_IDENTIFIER
AlgorithmIdentifier
for this structure.Source§impl<P: MlDsaParams> RandomizedSigner<Signature<P>> for SigningKey<P>
Available on crate feature rand_core
only.The RandomizedSigner
implementation for SigningKey
only supports signing with an empty
context string. If you would like to include a context string, use the [SigningKey::sign
]
method.
impl<P: MlDsaParams> RandomizedSigner<Signature<P>> for SigningKey<P>
Available on crate feature
rand_core
only.The RandomizedSigner
implementation for SigningKey
only supports signing with an empty
context string. If you would like to include a context string, use the [SigningKey::sign
]
method.
Source§fn try_sign_with_rng(
&self,
rng: &mut impl CryptoRngCore,
msg: &[u8],
) -> Result<Signature<P>, Error>
fn try_sign_with_rng( &self, rng: &mut impl CryptoRngCore, msg: &[u8], ) -> Result<Signature<P>, Error>
Attempt to sign the given message, returning a digital signature on
success, or an error if something went wrong. Read more
Source§fn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S
fn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S
Sign the given message and return a digital signature
Source§impl<P: MlDsaParams> SignatureBitStringEncoding for Signature<P>
Available on crate feature alloc
only.
impl<P: MlDsaParams> SignatureBitStringEncoding for Signature<P>
Available on crate feature
alloc
only.Source§fn to_bitstring(&self) -> Result<BitString>
fn to_bitstring(&self) -> Result<BitString>
BitString
encoding for this signature.Source§impl<P: MlDsaParams> SignatureEncoding for Signature<P>
impl<P: MlDsaParams> SignatureEncoding for Signature<P>
Source§impl<P: MlDsaParams> Signer<Signature<P>> for KeyPair<P>
The Signer
implementation for KeyPair
uses the optional deterministic variant of ML-DSA, and
only supports signing with an empty context string.
impl<P: MlDsaParams> Signer<Signature<P>> for KeyPair<P>
The Signer
implementation for KeyPair
uses the optional deterministic variant of ML-DSA, and
only supports signing with an empty context string.
Source§impl<P: MlDsaParams> Signer<Signature<P>> for SigningKey<P>
The Signer
implementation for SigningKey
uses the optional deterministic variant of ML-DSA, and
only supports signing with an empty context string. If you would like to include a context
string, use the SigningKey::sign_deterministic
method.
impl<P: MlDsaParams> Signer<Signature<P>> for SigningKey<P>
The Signer
implementation for SigningKey
uses the optional deterministic variant of ML-DSA, and
only supports signing with an empty context string. If you would like to include a context
string, use the SigningKey::sign_deterministic
method.
Source§impl<P: MlDsaParams> TryInto<Array<u8, <P as SignatureParams>::SignatureSize>> for Signature<P>
impl<P: MlDsaParams> TryInto<Array<u8, <P as SignatureParams>::SignatureSize>> for Signature<P>
Source§impl<P: MlDsaParams> Verifier<Signature<P>> for VerifyingKey<P>
impl<P: MlDsaParams> Verifier<Signature<P>> for VerifyingKey<P>
impl<P: MlDsaParams> StructuralPartialEq for Signature<P>
Auto Trait Implementations§
impl<P> Freeze for Signature<P>where
<<P as ParameterSet>::Lambda as ArraySize>::ArrayType<u8>: Freeze,
<<P as ParameterSet>::L as ArraySize>::ArrayType<Polynomial<BaseField>>: Freeze,
<<P as ParameterSet>::K as ArraySize>::ArrayType<Array<bool, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>: Freeze,
impl<P> RefUnwindSafe for Signature<P>where
<<P as ParameterSet>::Lambda as ArraySize>::ArrayType<u8>: RefUnwindSafe,
<<P as ParameterSet>::L as ArraySize>::ArrayType<Polynomial<BaseField>>: RefUnwindSafe,
<<P as ParameterSet>::K as ArraySize>::ArrayType<Array<bool, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>: RefUnwindSafe,
impl<P> Send for Signature<P>
impl<P> Sync for Signature<P>
impl<P> Unpin for Signature<P>where
<<P as ParameterSet>::Lambda as ArraySize>::ArrayType<u8>: Unpin,
<<P as ParameterSet>::L as ArraySize>::ArrayType<Polynomial<BaseField>>: Unpin,
<<P as ParameterSet>::K as ArraySize>::ArrayType<Array<bool, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>: Unpin,
impl<P> UnwindSafe for Signature<P>where
<<P as ParameterSet>::Lambda as ArraySize>::ArrayType<u8>: UnwindSafe,
<<P as ParameterSet>::L as ArraySize>::ArrayType<Polynomial<BaseField>>: UnwindSafe,
<<P as ParameterSet>::K as ArraySize>::ArrayType<Array<bool, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DynAssociatedAlgorithmIdentifier for Twhere
T: AssociatedAlgorithmIdentifier,
impl<T> DynAssociatedAlgorithmIdentifier for Twhere
T: AssociatedAlgorithmIdentifier,
Source§fn algorithm_identifier(&self) -> Result<AlgorithmIdentifier<Any>, Error>
fn algorithm_identifier(&self) -> Result<AlgorithmIdentifier<Any>, Error>
AlgorithmIdentifier
for this structure.