liboqs icon indicating copy to clipboard operation
liboqs copied to clipboard

Add stateful hash-based signatures

Open dstebila opened this issue 3 years ago • 2 comments

LMS and XMSS as standardized by CFRG may be of use to Verisign and others.

dstebila avatar Sep 30 '21 21:09 dstebila

Stateful hash-based signatures won't fit within our current liboqs API for signature schemes, because the signing algorithm for those treat the secret key as a read-only input, whereas a stateful HBS scheme would need to modify the secret key during the signing operation. So the API would need to be adapted. We'd also have to consider whether to include mechanisms for reading/writing the secret key to/from files, or whether to leave that to the caller. Safe management of this update operation is critical as reuse / loss of state can be catastrophic for security.

Check out related literature and implementations: https://github.com/XMSS/xmss-reference, https://eprint.iacr.org/2020/470.pdf, http://www.amphawa.eu/data/icmu-paper.pdf

Eventually we'll also want to consider what can be done in OQS-OpenSSL. It will be hard to add stateful HBS signing (since the OpenSSL signature API would have to be modified at many places) but might be easier and sufficient for limited applications to first add verification for stateful HBS schemes, since those don't actually require any state to be stored/updated (and thus have the same API for verification).

dstebila avatar Dec 07 '21 20:12 dstebila

In preparation for merge of the stateful-sigs branch here's some observations where I wonder whether this is all as intended:

Lastly, is there some overall documentation explaining how this is intended to be used? Some sample code at least along the lines of this. Apologies if I overlooked this. I did find the test but it seems overly convoluted for someone just interested in (learning how to) use a stateful sig, no?

baentsch avatar Dec 01 '23 15:12 baentsch