diff --git a/lee/state_machine/core/src/encryption/shared_key_derivation.rs b/lee/state_machine/core/src/encryption/shared_key_derivation.rs index 71bcf144..c476b71f 100644 --- a/lee/state_machine/core/src/encryption/shared_key_derivation.rs +++ b/lee/state_machine/core/src/encryption/shared_key_derivation.rs @@ -97,9 +97,11 @@ impl SharedSecretKey { ) -> (Self, EphemeralPublicKey) { use risc0_zkvm::sha::{Impl, Sha256 as _}; - let mut input = [0_u8; 32 + 4]; - input[0..32].copy_from_slice(message_hash); - input[32..36].copy_from_slice(&output_index.to_le_bytes()); + const PREFIX: &[u8; 21] = b"/LEE/v0.3/KDF-ML-KEM/"; + let mut input = [0; 21 + 32 + 4]; + input[0..21].copy_from_slice(PREFIX); + input[21..53].copy_from_slice(message_hash); + input[53..57].copy_from_slice(&output_index.to_le_bytes()); let hash = Impl::hash_bytes(&input); let m: ml_kem::B32 = ml_kem::array::Array::try_from(hash.as_bytes()).expect("SHA-256 output is 32 bytes");