|
| 1 | +# wolfSSL Post-Quantum Cryptography Stateful Hash-based Signatures Example |
| 2 | + |
| 3 | +This directory contains: |
| 4 | + |
| 5 | +- A simple example that uses wolfCrypt LMS/HSS hooks to sign and verify a message |
| 6 | + with configurable LMS/HSS parameters. Requires wolfssl with `--enable-lms=yes` |
| 7 | + and `--with-liblms=<path to hash-sigs install>`. |
| 8 | + |
| 9 | +# Prerequisites |
| 10 | + |
| 11 | +The LMS sign verify example requires that hash-sigs has been built, and |
| 12 | +wolfSSL has been built with LMS/HSS support enabled. Please see Item 17 |
| 13 | +in the wolfSSL repo's INSTALL file. |
| 14 | + |
| 15 | +https://github.com/wolfSSL/wolfssl/blob/master/INSTALL |
| 16 | + |
| 17 | +## Building the Applications |
| 18 | + |
| 19 | +Configure the Makefile to point to your hash-sigs install: |
| 20 | + |
| 21 | +``` |
| 22 | +HSS_INC = <path to hss install> |
| 23 | +``` |
| 24 | + |
| 25 | +``` |
| 26 | +HSS_LIB = <path to hss_lib_thread.a> |
| 27 | +``` |
| 28 | + |
| 29 | +Then build: |
| 30 | + |
| 31 | +``` |
| 32 | +$ make |
| 33 | +``` |
| 34 | + |
| 35 | +## Signing and Verifying a Message with LMS/HSS |
| 36 | + |
| 37 | +This example will generate an LMS/HSS key pair with L=levels, H=height, and |
| 38 | +W=Winternitz parameters, then sign and verify a given number of signatures. |
| 39 | +It will also print the signature size, the total number of signatures, and |
| 40 | +the public and private key lengths. |
| 41 | + |
| 42 | +While LMS/HSS have small public and private keys, and fast signing and |
| 43 | +verifying, the initial key generation can be quite slow and intensive, |
| 44 | +especially for larger heights and Winternitz parameters. |
| 45 | + |
| 46 | +LMS/HSS signature systems have a finite number of one-time signatures (OTS). |
| 47 | +The number of available signatures is |
| 48 | + N = 2 ** (levels * height) |
| 49 | + |
| 50 | +The supported parameter values are those in RFC8554: |
| 51 | +- levels = {1..8} |
| 52 | +- height = {5, 10, 15, 20, 25} |
| 53 | +- Winternitz = {1, 2, 4, 8} |
| 54 | + |
| 55 | +To see the help and usage, run the program without options: |
| 56 | +```sh |
| 57 | +$./lms_example |
| 58 | +usage: |
| 59 | + ./lms_example <levels> <height> <winternitz> [num signatures] |
| 60 | + |
| 61 | +examples: |
| 62 | + ./lms_example 1 5 1 |
| 63 | + ./lms_example 3 5 4 100 |
| 64 | + ./lms_example 2 10 2 0 |
| 65 | + |
| 66 | +description: |
| 67 | +... |
| 68 | +``` |
0 commit comments