Tafrah is a Rust-native post-quantum cryptography workspace covering FIPS 203, 204, and 205 together with FIPS 206 and 207, which NIST lists as selected algorithms with FIPS coming soon status.
The repository is organized around three layers:
- Native Rust crates for Rust consumers and
no_std-friendly core implementations. - An installable C ABI in
tafrah-abifor language wrappers and systems integration. - UniFFI bindings and example wrappers for higher-level host integrations.
tafrah/: umbrella crate for Rust consumers.tafrah-ml-kem/: FIPS 203 ML-KEM.tafrah-ml-dsa/: FIPS 204 ML-DSA.tafrah-slh-dsa/: FIPS 205 SLH-DSA.tafrah-falcon/: FIPS 206 Falcon.tafrah-hqc/: FIPS 207 HQC.tafrah-abi/: installable C ABI and headers.tafrah-uniffi/: UniFFI-facing wrapper crate.tafrah-math/: shared finite-field, matrix, polynomial, and sampling primitives.tafrah-traits/: shared traits and common error surface.examples/auth-demo/: beginner-oriented cross-language implementation examples.docs/: architecture, integration, and API documentation.
make test
make install PREFIX="$PWD/dist/install"
make examplesCommon root targets:
make testmake test-referencemake test-deep-slhmake coveragemake buildmake build-abimake build-uniffimake installmake examplesmake demo-pythonmake generate-uniffi UNIFFI_LANGUAGE=python
Beginner-friendly examples and proof scripts live in examples/README.md.
The primary example bundle is examples/auth-demo/README.md. It includes:
- a direct Rust crate example
- a Python
ctypeswrapper - C++, Go, Java, Kotlin, and JavaScript bindings over the C ABI
- a richer Python proof script for chat, file encryption, signatures, and small benchmarks
tafrah-abi installs into a prefix with the following layout:
lib/libtafrah_abi.{so,dylib}ortafrah_abi.dllinclude/tafrah/tafrah.hinclude/tafrah/tafrah.hppinclude/tafrah_abi.hinclude/tafrah_ffi.has a compatibility shimlib/pkgconfig/tafrah.pc
For a local install:
make install PREFIX="$PWD/dist/install"