Repository navigation
Migration from 0.4.x
- MSRV is 1.85 (was 1.70). The public API is unchanged.
Changed
DecapsKey::try_from_bytesrejects a key with a secret coefficient of q or more. For such a key,ml_kem_*_decapsin the C library returnsML_KEM_DESERIALIZATION_ERROR(wasML_KEM_DECAPSULATION_ERROR).KeyGen::validate_keypair_with_rng_vartimeandEncaps::encaps_from_seedare#[must_use].- Secret intermediate values are zeroized, best effort: copies of keys that are moved or passed by value can remain on the stack.
- Python:
libfips203is loaded fromFIPS203_PYTHON_TESTING_LIBRARYif set, else from the system library path (no longer from../../target/debug). - Building the crate itself, as distributions do, no longer fails on new compiler warnings or with no parameter-set feature.
Fixed
- Decapsulation rounds Decompress to the nearest integer, as FIPS 203 eq. 4.8 requires. 0.4.x rounded up, so with a crafted key pair a correctly encapsulated ciphertext could decapsulate to the implicit-rejection key.
- FFI:
ml_kem_populate_seedreturnsML_KEM_KEYGEN_ERRORwhen the OS RNG fails, instead of aborting. - FFI:
fips203.hcan be included in more than one C file. - FFI: linker flags follow the target, not the build machine, so cross builds work and Android gets an unversioned SONAME.
On crates.io: fips203 0.5.0 and fips203-ffi 0.5.0 · API docs