pub struct MlDsaSecretKey { /* private fields */ }Expand description
ML-DSA expanded private key encoded with FIPS 204 Algorithm 24 (skEncode).
In particular, bytes 64..128 contain the complete 64-byte tr = H(pk, 64)
value. Bare bytes do not carry a format version, so use paired import or
external provenance/framing when distinguishing affected legacy objects.
Implementations§
Source§impl MlDsaSecretKey
impl MlDsaSecretKey
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, SignError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, SignError>
Decode and fully validate a final-FIPS-204 expanded private key.
Validation recomputes A*s1+s2, t1, t0, the public key, and the
64-byte tr; the returned key always retains its derived public key.
Sourcepub fn from_bytes_with_public_key(
bytes: &[u8],
public_key: &MlDsaPublicKey,
) -> Result<Self, SignError>
pub fn from_bytes_with_public_key( bytes: &[u8], public_key: &MlDsaPublicKey, ) -> Result<Self, SignError>
Decode an expanded private key and validate it against its public key.
Besides validating the expanded key itself, this requires the supplied public key to equal the public key derived from all secret components.
Sourcepub fn to_bytes_zeroizing(&self) -> ZeroizingBytes
pub fn to_bytes_zeroizing(&self) -> ZeroizingBytes
Export the expanded private key into exact-size zeroizing storage.
Sourcepub fn public_key(&self) -> Result<MlDsaPublicKey, SignError>
pub fn public_key(&self) -> Result<MlDsaPublicKey, SignError>
Return the public key retained at generation or paired import time.
Trait Implementations§
Source§impl AsRef<[u8]> for MlDsaSecretKey
impl AsRef<[u8]> for MlDsaSecretKey
Source§impl Clone for MlDsaSecretKey
impl Clone for MlDsaSecretKey
Source§fn clone(&self) -> MlDsaSecretKey
fn clone(&self) -> MlDsaSecretKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MlDsaSecretKey
impl Debug for MlDsaSecretKey
Source§impl Drop for MlDsaSecretKey
impl Drop for MlDsaSecretKey
impl ZeroizeOnDrop for MlDsaSecretKey
Auto Trait Implementations§
impl Freeze for MlDsaSecretKey
impl RefUnwindSafe for MlDsaSecretKey
impl Send for MlDsaSecretKey
impl Sync for MlDsaSecretKey
impl Unpin for MlDsaSecretKey
impl UnsafeUnpin for MlDsaSecretKey
impl UnwindSafe for MlDsaSecretKey
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> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Upper case
letters are used (e.g. F9B4CA)