wolfssl-examples/pq/ml_dsa
jordan e5fdf2e1ee tiny cleanup to ml_dsa makefile. 2024-11-01 13:49:36 -05:00
..
Makefile tiny cleanup to ml_dsa makefile. 2024-11-01 13:49:36 -05:00
README.md small readme cleanup. 2024-11-01 13:42:18 -05:00
ml_dsa.c pq: ML-DSA example. 2024-11-01 13:37:40 -05:00

README.md

Description

Simple example of wolfCrypt ML-DSA keygen, signing, and verifying.

Requires wolfSSL is built with:

./configure --enable-dilithium
make
make install

Build the ML-DSA example with:

make ml_dsa_test

Usage

./ml_dsa_test -?
usage:
  ./ml_dsa_test [-pvw] -c <security category> [-m <message>]

parms:
  -m <message>               the message to sign
  -c <security category>     set the security category {2,3,5}
  -p                         print FIPS 204 parameters and exit
  -v                         verbose
  -w                         write keys, msg, and sig to file
  -?                         show this help

Keygen, sign, and verify

This will generate a keypair with security category 5, then sign and verify a test message, and write the keys, message, and signature to *.key and *.bin files:

./ml_dsa_test -c 5 -m "my test message" -w
info: making key
info: using ML-DSA-87, Security Category 5: priv_len 4896, pub_len 2592, sig_len 4627
info: signed message
info: verify message good
info: done

Print Supported ML-DSA Parameters

To see the supported parameters:

./ml_dsa_test -p
ML-DSA parameters and key/sig sizes*

                Private Key   Public Key   Signature Size   Security Strength
    ML-DSA-44      2560          1312         2420            Category 2
    ML-DSA-65      4032          1952         3309            Category 3
    ML-DSA-87      4896          2592         4627            Category 5


* from Tables 1 & 2 of FIPS 204:
    https://csrc.nist.gov/pubs/fips/204/final