Skip to main content

MlDsa87

Struct MlDsa87 

Source
pub struct MlDsa87;
Expand description

Marker type implementing [quantaegis_core::Signature] for ML-DSA-87 (NIST Security Category 5).

Implementations§

Source§

impl MlDsa87

Source

pub fn from_seed(seed: &[u8; 32]) -> (VerifyingKey, SigningKey)

Derives a (VerifyingKey, SigningKey) keypair deterministically from a 32-byte FIPS 204 seed xi (recommended format in RFC 9881).

Note: returning SigningKey by value in safe Rust can leave an unzeroized copy in the callee’s return staging slot; FIPS/zeroization-critical callers should prefer Self::keygen_into directly into caller-owned storage.

Source

pub fn keygen_into<R: CryptoRng + ?Sized>( rng: &mut R, vk_out: &mut VerifyingKey, sk_out: &mut SigningKey, ) -> Result<()>

Generates a fresh key pair directly into caller-owned storage and volatile-zeroizes stack temporaries (FIPS 204, Algorithm 1).

Source

pub fn sign_deterministic( sk: &SigningKey, msg: &[u8], ctx: &[u8], ) -> Result<Signature>

Signs msg with context ctx in deterministic mode (rnd = [0; 32]).

Source

pub fn sign_mu<R: CryptoRng + ?Sized>( sk: &SigningKey, mu: &[u8; 64], rng: &mut R, ) -> Result<Signature>

Signs a precomputed 64-byte External-mu mu in hedged mode.

Source

pub fn sign_mu_deterministic( sk: &SigningKey, mu: &[u8; 64], ) -> Result<Signature>

Signs a precomputed 64-byte External-mu mu in deterministic mode (rnd = [0; 32]).

Source

pub fn verify_mu( vk: &VerifyingKey, mu: &[u8; 64], sig: &Signature, ) -> Result<()>

Verifies sig against a precomputed 64-byte External-mu mu.

Trait Implementations§

Source§

impl Signature for MlDsa87

Source§

fn keygen<R: CryptoRng + ?Sized>( rng: &mut R, ) -> Result<(Self::VerifyingKey, Self::SigningKey)>

Generates a fresh key pair by value; FIPS/zeroization-critical callers should prefer Self::keygen_into to avoid safe-Rust return-slot staging copies.

Source§

type VerifyingKey = VerifyingKey

Public verifying key type.
Source§

type SigningKey = SigningKey

Private signing key type (must zeroize on drop).
Source§

type Sig = Signature

Signature type.
Source§

fn sign<R: CryptoRng + ?Sized>( sk: &Self::SigningKey, msg: &[u8], ctx: &[u8], rng: &mut R, ) -> Result<Self::Sig>

Signs msg with optional domain-separation context string ctx (at most 255 bytes in FIPS 204/205) using fresh randomness from rng (hedged mode). Read more
Source§

fn verify( vk: &Self::VerifyingKey, msg: &[u8], ctx: &[u8], sig: &Self::Sig, ) -> Result<()>

Verifies sig over msg and ctx using vk.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.