Tafrah
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 across the implemented ML-KEM, ML-DSA, SLH-DSA, Falcon, and HQC parameter sets exposed by the workspace. - UniFFI bindings and example wrappers for higher-level host integrations.
Library Layout
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.
Quick Start
Common root targets:
make testmake test-referencemake test-deep-slhmake coveragemake buildmake build-abimake build-uniffimake installmake examplesmake demo-pythonmake generate-uniffi UNIFFI_LANGUAGE=python
Documentation
- INSTALL.md
- docs/README.md
- docs/platform-support.md
- docs/embedded.md
- docs/performance.md
- docs/security.md
- SECURITY.md
- CHANGELOG.md
Examples
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
Install Layout
tafrah-abi installs into a prefix with the following layout:
lib/libtafrah_abi.{so,dylib}ortafrah_abi.dlllib/libtafrah_abi.aortafrah_abi.libinclude/tafrah/tafrah.hinclude/tafrah/tafrah.hppinclude/tafrah_abi.hinclude/tafrah_ffi.has a compatibility shimlib/pkgconfig/tafrah.pc
For a local install:
Prebuilt Releases And Source Builds
GitHub Release assets are architecture-specific. Current release packaging is planned around:
- Linux
x86_64 - Linux
aarch64 - macOS
arm64 - macOS
x86_64 - Windows
x86_64
If no prebuilt asset matches the target machine, build from source from the repository root:
For Rust consumers, prefer the native crates from crates.io instead of the ABI layer.
WARNING: FN-DSA (FIPS 206) and HQC (FIPS 207) have been selected by NIST but the standards are not yet finalized. This implementation follows the currently available specifications and may change once the official standards are published. Backward compatibility is not guaranteed.