pub fn decaps_single<P: Params>(
dk: &[u8],
c: &[u8],
) -> Result<[u8; 32], MlKemError>Expand description
Decapsulate without double computation (single-pass variant).
Performs length validation and the H(ek) integrity check on the
decapsulation key, then runs decaps_internal once. This is faster
than decaps but does not detect single-fault injection attacks.
Suitable for software-only environments where physical fault attacks are not in the threat model.
§Arguments
dk- The decapsulation (private) key, exactlyParams::DK_LENbytes.c- The ciphertext, exactlyParams::CT_LENbytes.
§Returns
The 32-byte shared secret.
§Errors
MlKemError::InvalidDecapsulationKeyifdkhas wrong length or fails the integrity check.MlKemError::InvalidCiphertextifchas wrong length.