Skip to main content

encaps_internal

Function encaps_internal 

Source
pub fn encaps_internal<P: Params>(
    ek: &[u8],
    m: &[u8; 32],
) -> ([u8; 32], Vec<u8>)
Expand description

Deterministic ML-KEM encapsulation (Algorithm 17).

Computes the shared secret and ciphertext from an encapsulation key and an explicit 32-byte message m. The shared secret and encryption randomness are derived as (K, r) = G(m || H(ek)).

No input validation is performed on ek; callers should use encaps for production use.

§Arguments

  • ek - The encapsulation (public) key.
  • m - 32-byte random message seed.

§Returns

A tuple (shared_secret, ciphertext).