pub trait MLDSAPrivateKeyTrait<const k: usize, const l: usize, const eta: usize, const SK_LEN: usize, const PK_LEN: usize>: SignaturePrivateKey<SK_LEN> {
// Required methods
fn seed(&self) -> Option<&KeyMaterial<32>>;
fn tr(&self) -> &[u8; 64];
fn A_hat(&self) -> Matrix<k, l>;
fn derive_pk(&self) -> MLDSAPublicKey<k, l, PK_LEN>;
fn sk_decode(sk: &[u8; SK_LEN]) -> Result<Self, SignatureError>;
}Expand description
General trait for all ML-DSA private keys types.
Required MethodsΒ§
Sourcefn seed(&self) -> Option<&KeyMaterial<32>>
fn seed(&self) -> Option<&KeyMaterial<32>>
Get a ref to the seed, if there is one stored with this private key
Sourcefn derive_pk(&self) -> MLDSAPublicKey<k, l, PK_LEN>
fn derive_pk(&self) -> MLDSAPublicKey<k, l, PK_LEN>
This is a partial implementation of keygen_internal(), and probably not allowed in FIPS mode.
Sourcefn sk_decode(sk: &[u8; SK_LEN]) -> Result<Self, SignatureError>
fn sk_decode(sk: &[u8; SK_LEN]) -> Result<Self, SignatureError>
Algorithm 25 skDecode(π π) Reverses the procedure skEncode. Input: Private key π π β πΉ32+32+64+32β ((β+π)β bitlen (2π)+ππ). Output: π β πΉ32, πΎ β πΉ32, π‘π β πΉ64 , π¬1 β π β, π¬2 β π π, π0 β π π with coefficients in [β2πβ1 + 1, 2πβ1].
Note: this object contains only the simple decoding routine to unpack a semi-expanded key.
See MLDSATrait for key generation functions, including derive-from-seed and consistency-check functions.
Dyn CompatibilityΒ§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.