This directory contains a minimal example for building mldsa-native as a single compilation unit
with native assembly backends, using the auto-generated mldsa_native.c and mldsa_native_asm.S files.
Use this approach when:
- You need only one ML-DSA parameter set (44, 65, or 87)
- You want simple build integration with optimal performance
- Source tree mldsa_native/*, including top-level compilation unit mldsa_native.c (gathering all C sources), mldsa_native_asm.S (gathering all assembly sources), and the mldsa-native API mldsa_native.h.
- A secure random number generator implementing
randombytes.h - Your application source code
The configuration file mldsa_native_config.h sets:
MLD_CONFIG_PARAMETER_SET: Security level (default 65)MLD_CONFIG_NAMESPACE_PREFIX: Symbol prefix (set tomldsa)MLD_CONFIG_USE_NATIVE_BACKEND_ARITH: Enables native arithmetic backendMLD_CONFIG_USE_NATIVE_BACKEND_FIPS202: Enables native FIPS-202 backend
- Both
mldsa_native.candmldsa_native_asm.Smust be compiled and linked - Native backends are auto-selected based on target architecture
- On unsupported platforms, the C backend is used automatically
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.