package mlkem
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=20087fca24222c6de0db3a2d2b05f9c1
sha512=69bdfe62d0a93ff4dbe85280b7fd3db9970adbc36f52891f63e727a4eb32a19bfccf727a62d3740d4771522489cdcbb4feaa3537cdd9b183962252065674ed32
doc/mlkem/Mlkem/Mlkem768/index.html
Module Mlkem.Mlkem768Source
ML-KEM-768, as standardized by FIPS 203.
Keys, ciphertexts, and shared secrets have distinct abstract types. All parsing functions reject inputs of the wrong length. Encapsulation-key parsing also performs the FIPS 203 modulus check.
The caller supplies randomness so that this library stays portable across Unix, MirageOS unikernels, and js_of_ocaml. The callback must return exactly the requested number of cryptographically secure random bytes.
pp_error formats a parsing error for humans.
The size of a seed-encoded decapsulation key: 64 bytes (d || z).
The size of an encoded encapsulation key: 1184 bytes.
The size of a ciphertext: 1088 bytes.
The size of a shared secret: 32 bytes.
generate ~random () creates a key pair from 64 bytes obtained from random.
decapsulation_key_of_seed seed expands the canonical 64-byte d || z representation.
decapsulation_key_to_seed key returns a fresh 64-byte seed encoding. The result is secret key material.
shared_secret_to_octets secret returns a fresh 32-byte string.
encapsulate ~random key obtains 32 bytes from random, then produces a ciphertext and shared secret.
decapsulate key ciphertext always returns a shared secret. Invalid same-length ciphertexts are handled with FIPS 203 implicit rejection.