pub struct VerifyingKey<P: ParameterSet> { /* private fields */ }Expand description
An ML-DSA verification key.
Implementations§
Source§impl<P: MlDsaParams> VerifyingKey<P>
impl<P: MlDsaParams> VerifyingKey<P>
Sourcepub fn compute_mu<F: FnOnce(&mut Shake256) -> Result<(), Error>>(
&self,
Mp: F,
ctx: &[u8],
) -> Result<Array<u8, U64>, Error>
pub fn compute_mu<F: FnOnce(&mut Shake256) -> Result<(), Error>>( &self, Mp: F, ctx: &[u8], ) -> Result<Array<u8, U64>, Error>
Sourcepub fn verify_internal(&self, M: &[u8], sigma: &Signature<P>) -> boolwhere
P: MlDsaParams,
pub fn verify_internal(&self, M: &[u8], sigma: &Signature<P>) -> boolwhere
P: MlDsaParams,
Implementation of Algorithm 8: ML-DSA.Verify_internal algorithm from FIPS 204.
It does not include the domain separator that distinguishes between the normal and pre-hashed cases, and it does not separate the context string from the rest of the message.
Sourcepub fn verify_with_context(
&self,
M: &[u8],
ctx: &[u8],
sigma: &Signature<P>,
) -> bool
pub fn verify_with_context( &self, M: &[u8], ctx: &[u8], sigma: &Signature<P>, ) -> bool
Implementation of Algorithm 3: ML-DSA.Verify from FIPS 204.
Sourcepub fn verify_mu(&self, mu: &Array<u8, U64>, sigma: &Signature<P>) -> bool
pub fn verify_mu(&self, mu: &Array<u8, U64>, sigma: &Signature<P>) -> bool
Implementation of Algorithm 3: ML-DSA.Verify from FIPS 204 with a pre-computed μ.
Sourcepub fn encode(&self) -> EncodedVerifyingKey<P>
pub fn encode(&self) -> EncodedVerifyingKey<P>
Encode the key in a fixed-size byte array.
Implementation of Algorithm 22: pkEncode from FIPS 204.
Sourcepub fn decode(enc: &EncodedVerifyingKey<P>) -> Self
pub fn decode(enc: &EncodedVerifyingKey<P>) -> Self
Decode the key from an appropriately sized byte array.
Implementation of Algorithm 23: pkDecode from FIPS 204.
Trait Implementations§
Source§impl<P: MlDsaParams> AsRef<VerifyingKey<P>> for SigningKey<P>
Available on crate feature alloc only.
impl<P: MlDsaParams> AsRef<VerifyingKey<P>> for SigningKey<P>
Available on crate feature
alloc only.Source§fn as_ref(&self) -> &VerifyingKey<P>
fn as_ref(&self) -> &VerifyingKey<P>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<P: Clone + ParameterSet> Clone for VerifyingKey<P>where
P::K: Clone,
impl<P: Clone + ParameterSet> Clone for VerifyingKey<P>where
P::K: Clone,
Source§fn clone(&self) -> VerifyingKey<P>
fn clone(&self) -> VerifyingKey<P>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<P: MlDsaParams> DigestVerifier<Shake<136>, Signature<P>> for VerifyingKey<P>
impl<P: MlDsaParams> DigestVerifier<Shake<136>, Signature<P>> for VerifyingKey<P>
Source§impl<P> EncodePublicKey for VerifyingKey<P>
Available on crate features pkcs8 and alloc only.
impl<P> EncodePublicKey for VerifyingKey<P>
Available on crate features
pkcs8 and alloc only.Source§impl<P: MlDsaParams> Hash for VerifyingKey<P>
impl<P: MlDsaParams> Hash for VerifyingKey<P>
Source§impl<P: MlDsaParams> KeyExport for VerifyingKey<P>
impl<P: MlDsaParams> KeyExport for VerifyingKey<P>
Source§impl<P: MlDsaParams> KeyInit for VerifyingKey<P>
impl<P: MlDsaParams> KeyInit for VerifyingKey<P>
Source§fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
Create new value from variable size key. Read more
Source§impl<P: MlDsaParams> KeySizeUser for VerifyingKey<P>
impl<P: MlDsaParams> KeySizeUser for VerifyingKey<P>
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>
Equivalent of
Verifier::verify() but the message is provided in non-contiguous byte
slices. Read moreSource§impl<P: PartialEq + ParameterSet> PartialEq for VerifyingKey<P>where
P::K: PartialEq,
impl<P: PartialEq + ParameterSet> PartialEq for VerifyingKey<P>where
P::K: PartialEq,
Source§fn eq(&self, other: &VerifyingKey<P>) -> bool
fn eq(&self, other: &VerifyingKey<P>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<P> SignatureAlgorithmIdentifier for VerifyingKey<P>
Available on crate feature pkcs8 only.
impl<P> SignatureAlgorithmIdentifier for VerifyingKey<P>
Available on crate feature
pkcs8 only.Source§const SIGNATURE_ALGORITHM_IDENTIFIER: AlgorithmIdentifier<Self::Params> = Signature<P>::ALGORITHM_IDENTIFIER
const SIGNATURE_ALGORITHM_IDENTIFIER: AlgorithmIdentifier<Self::Params> = Signature<P>::ALGORITHM_IDENTIFIER
AlgorithmIdentifier for the corresponding signature system.Source§impl<P> TryFrom<SubjectPublicKeyInfo<AnyRef<'_>, BitStringRef<'_>>> for VerifyingKey<P>
Available on crate feature pkcs8 only.
impl<P> TryFrom<SubjectPublicKeyInfo<AnyRef<'_>, BitStringRef<'_>>> for VerifyingKey<P>
Available on crate feature
pkcs8 only.Source§impl<P: MlDsaParams> Verifier<Signature<P>> for VerifyingKey<P>
impl<P: MlDsaParams> Verifier<Signature<P>> for VerifyingKey<P>
impl<P: ParameterSet> StructuralPartialEq for VerifyingKey<P>
Auto Trait Implementations§
impl<P> Freeze for VerifyingKey<P>
impl<P> RefUnwindSafe for VerifyingKey<P>where
<<P as ParameterSet>::K as ArraySize>::ArrayType<Polynomial<BaseField>>: RefUnwindSafe,
<<P as ParameterSet>::K as ArraySize>::ArrayType<NttVector<BaseField, <P as ParameterSet>::L>>: RefUnwindSafe,
<<P as ParameterSet>::K as ArraySize>::ArrayType<NttPolynomial<BaseField>>: RefUnwindSafe,
impl<P> Send for VerifyingKey<P>
impl<P> Sync for VerifyingKey<P>
impl<P> Unpin for VerifyingKey<P>
impl<P> UnsafeUnpin for VerifyingKey<P>where
<<P as ParameterSet>::K as ArraySize>::ArrayType<Polynomial<BaseField>>: UnsafeUnpin,
<<P as ParameterSet>::K as ArraySize>::ArrayType<NttVector<BaseField, <P as ParameterSet>::L>>: UnsafeUnpin,
<<P as ParameterSet>::K as ArraySize>::ArrayType<NttPolynomial<BaseField>>: UnsafeUnpin,
impl<P> UnwindSafe for VerifyingKey<P>where
<<P as ParameterSet>::K as ArraySize>::ArrayType<Polynomial<BaseField>>: UnwindSafe,
<<P as ParameterSet>::K as ArraySize>::ArrayType<NttVector<BaseField, <P as ParameterSet>::L>>: UnwindSafe,
<<P as ParameterSet>::K as ArraySize>::ArrayType<NttPolynomial<BaseField>>: UnwindSafe,
Blanket Implementations§
Source§impl<S, T> AsyncMultipartVerifier<S> for Twhere
T: MultipartVerifier<S>,
impl<S, T> AsyncMultipartVerifier<S> for Twhere
T: MultipartVerifier<S>,
Source§async fn multipart_verify_async(
&self,
msg: &[&[u8]],
signature: &S,
) -> Result<(), Error>
async fn multipart_verify_async( &self, msg: &[&[u8]], signature: &S, ) -> Result<(), Error>
Async equivalent of
MultipartVerifier::multipart_verify() where the
message is provided in non-contiguous byte slices.Source§impl<S, T> AsyncVerifier<S> for Twhere
T: Verifier<S>,
impl<S, T> AsyncVerifier<S> for Twhere
T: Verifier<S>,
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> DecodePublicKey for T
impl<T> DecodePublicKey for T
Source§impl<T> DynSignatureAlgorithmIdentifier for Twhere
T: SignatureAlgorithmIdentifier,
impl<T> DynSignatureAlgorithmIdentifier for Twhere
T: SignatureAlgorithmIdentifier,
Source§fn signature_algorithm_identifier(
&self,
) -> Result<AlgorithmIdentifier<Any>, Error>
fn signature_algorithm_identifier( &self, ) -> Result<AlgorithmIdentifier<Any>, Error>
AlgorithmIdentifier for the corresponding signature system. Read more