Struct crypto::SecretKey
zaun_community_protocol::crypto::SecretKey · Struct
pub struct SecretKey { … }A suite-1 composite private key: mldsaSeed (FIPS 204 ξ, 32 B) ‖ edSK (32 B).
Never on the wire. Debug is redacted and the bytes are zeroized on drop. Its component
keys are used only inside this composite (RFC 10073 the protocol).
The ML-DSA-65 expanded signing key is derived from the seed once, on first use, and kept
with the key (it is zeroized on drop too): deriving it is about a fifth of the cost of a
signature, and a host signs a session proof for every session.hello.
Methods
Section titled “Methods”generate
Section titled “generate”pub fn generate() -> Result<Self, RngError>A fresh key from the OS CSPRNG.
Errors
Section titled “Errors”RngError when getrandom fails.
from_bytes
Section titled “from_bytes”pub fn from_bytes(bytes: &[u8; 64]) -> SelfWraps the 64-byte encoding. The caller zeroizes its own copy.
expose_secret
Section titled “expose_secret”pub const fn expose_secret(&self) -> &[u8; 64]The 64-byte encoding, for sealed storage only.
public_key
Section titled “public_key”pub fn public_key(&self) -> PublicKeyThe composite public key: suite 0x01 ‖ mldsaPK ‖ edPK.
Trait implementations
Section titled “Trait implementations”Clone, Debug, Drop, Zeroize, ZeroizeOnDrop