| 1 |
[//]: # (SPDX-License-Identifier: CC-BY-4.0) |
| 2 |
|
| 3 |
# Basic build |
| 4 |
|
| 5 |
This directory contains a minimal example for how to build mldsa-native for a single security level. |
| 6 |
|
| 7 |
## Use Case |
| 8 |
|
| 9 |
Use this approach when: |
| 10 |
- You need only one ML-DSA parameter set (44, 65, or 87) |
| 11 |
- You want to build the mldsa-native C files separately, not as a single compilation unit. |
| 12 |
- You're using C only, no native backends. |
| 13 |
|
| 14 |
## Components |
| 15 |
|
| 16 |
1. mldsa-native source tree: [`mldsa/src/`](../../mldsa/src) and [`mldsa/src/fips202/`](../../mldsa/src/fips202) |
| 17 |
2. A secure random number generator implementing [`randombytes.h`](../../mldsa/src/randombytes.h) |
| 18 |
3. Your application source code |
| 19 |
|
| 20 |
## Configuration |
| 21 |
|
| 22 |
The configuration file [mldsa_native_config.h](mldsa_native/mldsa_native_config.h) sets: |
| 23 |
- `MLD_CONFIG_PARAMETER_SET`: Security level (44, 65, or 87). Default is 65. |
| 24 |
- `MLD_CONFIG_NAMESPACE_PREFIX`: Symbol prefix for the API. Set to `mldsa` in this example. |
| 25 |
|
| 26 |
To change the security level, modify `MLD_CONFIG_PARAMETER_SET` in the config file or pass it via CFLAGS. |
| 27 |
|
| 28 |
## Usage |
| 29 |
|
| 30 |
```bash |
| 31 |
make build # Build the example |
| 32 |
make run # Run the example |
| 33 |
``` |
| 34 |
|
| 35 |
## Warning |
| 36 |
|
| 37 |
The `randombytes()` implementation in `test_only_rng/` is for TESTING ONLY. |
| 38 |
You MUST provide a cryptographically secure RNG for production use. |