Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Monolithic Build (C Backend)

This directory contains a minimal example for building mldsa-native for a single parameter set of ML-DSA as a single compilation unit using the auto-generated mldsa_native.c file.

Use Case

Use this approach when:

  • You want the simplest possible build integration (one .c file)
  • You're using only C (no native backends)
  • You need only one ML-DSA parameter set (44, 65, or 87)

Components

  1. Source tree mldsa_native/*, including top-level compilation unit mldsa_native.c (gathering all C sources) and the mldsa-native API mldsa_native.h.
  2. A secure random number generator implementing randombytes.h
  3. Your application source code

Configuration

The configuration file mldsa_native_config.h sets:

  • MLD_CONFIG_PARAMETER_SET: Security level (default 65)
  • MLD_CONFIG_NAMESPACE_PREFIX: Symbol prefix (set to mldsa)
  • MLD_CONFIG_INTERNAL_API_QUALIFIER=static: Makes internal functions static for single-CU builds

The auto-generated mldsa_native.c:

  • Includes all mldsa-native C source files
  • Clears all internal #defines at the end, allowing multiple inclusion

Notes

  • The monolithic .c file is auto-generated by scripts/autogen
  • Internal functions become static, enabling better compiler optimization

Usage

make build   # Build the example
make run     # Run the example

Warning

The randombytes() implementation in test_only_rng/ is for TESTING ONLY. You MUST provide a cryptographically secure RNG for production use.