This directory contains a minimal example for how to build mlkem-native for a single security level.
Use this approach when:
- You need only one ML-KEM parameter set (512, 768, or 1024)
- You want to build the mlkem-native C files separately, not as a single compilation unit.
- You're using C only, no native backends.
- mlkem-native source tree:
mlkem/src/andmlkem/src/fips202/ - A secure random number generator implementing
randombytes.h - Your application source code
The configuration file mlkem_native_config.h sets:
MLK_CONFIG_PARAMETER_SET: Security level (512, 768, or 1024). Default is 768.MLK_CONFIG_NAMESPACE_PREFIX: Symbol prefix for the API. Set tomlkemin this example.
To change the security level, modify MLK_CONFIG_PARAMETER_SET in the config file or pass it via CFLAGS.
make build # Build the example
make run # Run the exampleThe randombytes() implementation in test_only_rng/ is for TESTING ONLY.
You MUST provide a cryptographically secure RNG for production use.