Skip to main content

derive_mesh_mldsa_key

Function derive_mesh_mldsa_key 

Source
pub fn derive_mesh_mldsa_key(ed25519_key: &SigningKey) -> MlDsaSigningKey
Expand description

Deterministically derive the node’s mesh ML-DSA-65 signing key from its persisted Ed25519 root/signing key (#157).

Uses derive_purpose_key (HKDF-SHA256 over the Ed25519 seed) with the dedicated MESH_MLDSA_PURPOSE label, then re-keys that 32-byte output as an ML-DSA-65 seed via crate::crypto::pq::ml_dsa_sk_from_seed. This is stable across restarts (no new key file) and key-separated from both the Ed25519 identity and the JWT ML-DSA keyset.

The matching public key (signing_key.verifying_key()) is what peers must anchor in their KeyedPqTrustStore, keyed by the Ed25519 signer identity.