11# Post-Quantum Signatures
22
33wolfBoot is adding support for post-quantum signatures. At present, support
4- for LMS/HSS signatures has been added.
4+ for LMS/HSS (https://www.rfc-editor.org/rfc/rfc8554.html ), and XMSS/XMSS^MT
5+ (https://www.rfc-editor.org/rfc/rfc8391.html ) has been added.
56
6- ## LMS/HSS
7-
8- LMS/HSS is a post-quantum stateful hash-based signature scheme (HBS). It
9- is known for having small public and private keys, but larger signatures.
10- The signature size is tunable via the different LMS parameters .
7+ LMS/HSS and XMSS/XMSS^MT are both post-quantum stateful hash-based signature
8+ (HBS) schemes. They are known for having small public keys, relatively fast
9+ signing and verifying operations, but larger signatures. Their signature sizes
10+ however are tunable via their different parameters, which affords a space-time
11+ tradeoff .
1112
1213Stateful HBS schemes are based on the security of their underlying hash
1314functions and Merkle trees, which are not expected to be broken by the advent
14- of cryptographically relevant quantum computers.
15+ of cryptographically relevant quantum computers. For this reason they have
16+ been recommended by both NIST SP 800-208, and the NSA’s CNSA 2.0 suite.
17+
18+ See these links for more info on stateful HBS support and wolfSSL/wolfCrypt:
19+ - https://www.wolfssl.com/documentation/manuals/wolfssl/appendix07.html#post-quantum-stateful-hash-based-signatures
20+ - https://github.com/wolfSSL/wolfssl-examples/tree/master/pq/stateful_hash_sig
21+
22+
23+ ## LMS/HSS
24+
1525
1626### Building with LMS Support
1727
@@ -44,7 +54,7 @@ keygen, signing, and verifying functionality. However wolfBoot
4454links directly with the subset of objects in the ` hss_verify.a `
4555build rule, as it only requires verify functionality.
4656
47- ### Config
57+ ### LMS Config
4858
4959A new LMS sim example has been added here:
5060```
@@ -69,17 +79,66 @@ In LMS the signature size is a function of the parameters. Use the added helper
6979script ` tools/lms/lms_siglen.sh ` to calculate your signature length given your
7080LMS parameters:
7181```
72- $./tools/lms/lms_siglen.sh
73- levels: 3
74- height: 5
75- winternitz: 8
76- #
77- total_len: 3992
82+ $ ./tools/lms/lms_siglen.sh 2 5 8
83+ levels: 2
84+ height: 5
85+ winternitz: 8
86+ signature length: 2644
7887```
7988
80- ### More Info
89+ ## XMSS/XMSS^MT
8190
82- See these links for more info on LMS and wolfSSL/wolfCrypt:
83- - https://www.wolfssl.com/documentation/manuals/wolfssl/appendix07.html#post-quantum-stateful-hash-based-signatures
84- - https://github.com/wolfSSL/wolfssl-examples/tree/master/pq/stateful_hash_sig
91+ ### Building with XMSS Support
92+
93+ XMSS/XMSS^MT support in wolfCrypt requires a patched version of the
94+ xmss-reference library ( https://github.com/XMSS/xmss-reference.git ).
95+ Use the following procedure to prepare xmss-reference for building with
96+ wolfBoot:
97+
98+ ```
99+ $ cd lib
100+ $ git clone https://github.com/XMSS/xmss-reference.git xmss
101+ $ ls
102+ CMakeLists.txt wolfPKCS11 wolfTPM wolfssl xmss
103+ $ cd xmss
104+ $ git checkout 171ccbd26f098542a67eb5d2b128281c80bd71a6
105+ $ git apply ../../../tools/xmss/0001-Patch-to-support-wolfSSL-xmss-reference-integration.patch
106+ ```
85107
108+ The patch creates an addendum readme, ` patch_readme.md ` , with further comments.
109+
110+ Nothing more is needed beyond the patch step, as wolfBoot will handle building
111+ the xmss build artifacts it requires.
112+
113+ ### XMSS Config
114+ A new XMSS sim example has been added here:
115+ ```
116+ config/examples/sim-xmss.config
117+ ```
118+
119+ The ` XMSS_PARAMS ` , ` IMAGE_SIGNATURE_SIZE ` , and (optionally) ` IMAGE_HEADER_SIZE `
120+ must be set:
121+
122+ ```
123+ SIGN?=XMSS
124+ ...
125+ XMSS_PARAMS='XMSS-SHA2_10_256'
126+ ...
127+ IMAGE_SIGNATURE_SIZE=2500
128+ IMAGE_HEADER_SIZE?=5000
129+ ```
130+
131+ The ` XMSS_PARAMS ` may be any SHA256 parameter set string from Tables 10 and 11
132+ from NIST SP 800-208. Use the helper script ` tools/xmss/xmss_siglen.sh ` to
133+ calculate your signature length given your XMSS/XMSS^MT parameter string, e.g.:
134+ ```
135+ $ ./tools/xmss/xmss_siglen.sh XMSS-SHA2_10_256
136+ parameter set: XMSS-SHA2_10_256
137+ signature length: 2500
138+ ```
139+
140+ ```
141+ $ ./tools/xmss/xmss_siglen.sh XMSSMT-SHA2_20/2_256
142+ parameter set: XMSSMT-SHA2_20/2_256
143+ signature length: 4963
144+ ```
0 commit comments