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>
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> DigestSigner<Shake256, Signature<P>> for KeyPair<P>
The DigestSigner implementation for KeyPair uses the optional deterministic variant of ML-DSA
with a pre-computed μ, and only supports signing with an empty context string.
impl<P: MlDsaParams> DigestSigner<Shake256, Signature<P>> for KeyPair<P>
The DigestSigner implementation for KeyPair uses the optional deterministic variant of ML-DSA
with a pre-computed μ, and only supports signing with an empty context string.
Source§impl<P: MlDsaParams> DigestSigner<Shake256, Signature<P>> for SigningKey<P>
The Signer implementation for SigningKey uses the optional deterministic variant of ML-DSA
with a pre-computed µ, and only supports signing with an empty context string. If you would
like to include a context string, use the SigningKey::sign_mu_deterministic method.
impl<P: MlDsaParams> DigestSigner<Shake256, Signature<P>> for SigningKey<P>
The Signer implementation for SigningKey uses the optional deterministic variant of ML-DSA
with a pre-computed µ, and only supports signing with an empty context string. If you would
like to include a context string, use the SigningKey::sign_mu_deterministic method.
Source§impl<P: MlDsaParams> DigestVerifier<Shake256, Signature<P>> for VerifyingKey<P>
impl<P: MlDsaParams> DigestVerifier<Shake256, Signature<P>> for VerifyingKey<P>
Source§impl<P: MlDsaParams> MultipartSigner<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> MultipartSigner<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§fn try_multipart_sign(&self, msg: &[&[u8]]) -> Result<Signature<P>, Error>
fn try_multipart_sign(&self, msg: &[&[u8]]) -> Result<Signature<P>, Error>
Signer::try_sign() but the
message is provided in non-contiguous byte slices.Source§fn multipart_sign(&self, msg: &[&[u8]]) -> S
fn multipart_sign(&self, msg: &[&[u8]]) -> S
Signer::sign() but the message
is provided in non-contiguous byte slices.Source§impl<P: MlDsaParams> MultipartSigner<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> MultipartSigner<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§fn try_multipart_sign(&self, msg: &[&[u8]]) -> Result<Signature<P>, Error>
fn try_multipart_sign(&self, msg: &[&[u8]]) -> Result<Signature<P>, Error>
Signer::try_sign() but the
message is provided in non-contiguous byte slices.Source§fn multipart_sign(&self, msg: &[&[u8]]) -> S
fn multipart_sign(&self, msg: &[&[u8]]) -> S
Signer::sign() but the message
is provided in non-contiguous byte slices.Source§impl<P: MlDsaParams> MultipartVerifier<Signature<P>> for VerifyingKey<P>
impl<P: MlDsaParams> MultipartVerifier<Signature<P>> for VerifyingKey<P>
Source§fn multipart_verify(
&self,
msg: &[&[u8]],
signature: &Signature<P>,
) -> Result<(), Error>
fn multipart_verify( &self, msg: &[&[u8]], signature: &Signature<P>, ) -> Result<(), Error>
Verifier::verify() but the
message is provided in non-contiguous byte slices.Source§impl<P: MlDsaParams> RandomizedDigestSigner<Shake256, 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_mu_randomized method.
impl<P: MlDsaParams> RandomizedDigestSigner<Shake256, Signature<P>> for SigningKey<P>
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_mu_randomized method.
Source§fn try_sign_digest_with_rng<R: TryCryptoRng + ?Sized, F: Fn(&mut Shake256) -> Result<(), Error>>(
&self,
rng: &mut R,
f: F,
) -> Result<Signature<P>, Error>
fn try_sign_digest_with_rng<R: TryCryptoRng + ?Sized, F: Fn(&mut Shake256) -> Result<(), Error>>( &self, rng: &mut R, f: F, ) -> Result<Signature<P>, Error>
Digest with it,
returning a digital signature on success, or an error if something went wrong. Read moreSource§impl<P: MlDsaParams> RandomizedMultipartSigner<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_randomized method.
impl<P: MlDsaParams> RandomizedMultipartSigner<Signature<P>> for SigningKey<P>
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_randomized method.
Source§fn try_multipart_sign_with_rng<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
msg: &[&[u8]],
) -> Result<Signature<P>, Error>
fn try_multipart_sign_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, msg: &[&[u8]], ) -> Result<Signature<P>, Error>
RandomizedSigner::try_sign_with_rng() but
the message is provided in non-contiguous byte slices.Source§fn multipart_sign_with_rng<R>(&self, rng: &mut R, msg: &[&[u8]]) -> S
fn multipart_sign_with_rng<R>(&self, rng: &mut R, msg: &[&[u8]]) -> S
RandomizedSigner::sign_with_rng() but
the message is provided in non-contiguous byte slices.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_randomized method.
impl<P: MlDsaParams> RandomizedSigner<Signature<P>> for SigningKey<P>
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_randomized method.
Source§impl<P: MlDsaParams> SignatureBitStringEncoding for Signature<P>
Available on crate features pkcs8 and alloc only.
impl<P: MlDsaParams> SignatureBitStringEncoding for Signature<P>
pkcs8 and 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
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.