- OS: Ubuntu 22.04
- Memory: At least 4-8 GB
- Disk Space: More than 5 GB
Install required tools and libraries:
sudo apt update
sudo apt install astyle cmake gcc ninja-build libssl-dev \
python3-pytest python3-pytest-xdist unzip xsltproc \
doxygen graphviz python3-yaml valgrind# Get the source code
git clone https://github.com/open-quantum-safe/liboqs.git
cd liboqs
# Create build directory
mkdir build && cd build
# Configure build with constant-time testing enabled
cmake -GNinja .. \
-DCMAKE_BUILD_TYPE=Debug \
-DOQS_ENABLE_TEST_CONSTANT_TIME=ON \
-DOQS_DIST_BUILD=ON
# Optional extra flags you can add:
# -DCMAKE_INSTALL_PREFIX=/usr/local # Install location
# -DOQS_USE_OPENSSL=ON # Use OpenSSL primitives
# -DOQS_ENABLE_KEM_CLASSIC_MCELIECE=OFF # Skip slow algorithms
# -DBUILD_SHARED_LIBS=ON # Build shared libs
# Build the library
ninja# From the build/ directory
python3 ../tests/test_constant_time.pyIgnore the extra line breaks — I pressed Enter multiple times to ensure the program hadn’t frozen.
# Test only Kyber
python3 ../tests/test_constant_time.py -k Kyber
# Test specific variant
python3 ../tests/test_constant_time.py -k ML-KEM-512
# Test with verbose output
python3 ../tests/test_constant_time.py -v -k Dilithium# Set environment variable to skip certain algorithms
export SKIP_ALGS="Classic-McEliece,HQC"
python3 ../tests/test_constant_time.py# Run Valgrind directly on a test binary
valgrind --tool=memcheck \
--error-exitcode=1 \
./tests/test_kem ML-KEM-512