Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 1.75 KB

BUILDING.md

File metadata and controls

66 lines (47 loc) · 1.75 KB

Building mlkem-native

Prerequisites

To build mlkem-native, you need make and a C90 compiler. To use the test scripts, you need Python3 with dependencies as specified in requirements.txt. We recommend using a virtual environment, e.g.:

python3 -m venv venv
./venv/bin/python3 -m pip install -r requirements.txt
source venv/bin/activate

Using make

You can build and test mlkem-native as follows:

make quickcheck       # With native code backend (if available)
make OPT=0 quickcheck # With C backend

To merely build test and benchmarking components, use the following make targets:

make mlkem
make bench
make bench_components
make nistkat
make kat

The resulting binaries can then be found in test/build.

Using tests script

We recommend compiling and running tests and benchmarks using the ./scripts/tests script. For example,

./scripts/tests func

will compile and run functionality tests. For detailed information on how to use the script, please refer to the --help option.

Nix setup

All the development and build dependencies are also specified in flake.nix. We recommend installing them using nix. To execute a bash shell with the development environment specified in flake.nix, run

nix develop --experimental-features 'nix-command flakes'

Windows

You can also build mlkem-native on Windows using nmake and an MSVC compiler.

To build and run the tests (only support functional testing for non-opt implementation for now), use the following nmake targets:

nmke /f .\Makefile.Microsoft_nmake quickcheck