Repository navigation
Conversation
randombit
force-pushed
the
jack/stateful-sig-tree-cache
branch
from
November 25, 2026 12:08
862cbab to
1c474f5
Compare
FAlbertDev
approved these changes
Nov 30, 2026
FAlbertDev
left a comment
Collaborator
There was a problem hiding this comment.
Unfortunately, I have no time for an extensive review of this entire merge request.
I like the new private key format and the time-memory trade-of. LGTM.
The private key is now encoded under a new OID (HSS-LMS-Private-Key, with the old OID renamed to HSS-LMS-Private-Key-legacy) and additionally holds the root of the top tree, plus for each level the tree nodes and parent signature needed for the next signature. Keys in the old format are still accepted, but the new format is always written. Signing with HW(10,1) goes from 10.95 ms to 0.05 ms, and with three levels from 89.9 ms to 0.10 ms. Loading a key no longer recomputes the top tree. Each signature is verified before it is returned. The speed tool now switches to a fresh key when the current one is exhausted. Add tests for the encoding and for concurrent signing.
The XMSS private key is now encoded under a new OID (XMSS-Private-Key) and additionally holds 1024 nodes of the tree, so that signing does not recompute it. Keys in the old format are still accepted, but the new format is always written. XMSS and LMS now share the code computing and storing the tree nodes. Signing with XMSS-SHA2_10_256 goes from 40.9 ms to 0.16 ms, and with XMSS-SHAKE_10_512 from 376 ms to 1.11 ms. Key generation is unchanged. Each signature is verified before it is returned. Add tests for the encoding, for concurrent signing, and for the shared tree code.
randombit
force-pushed
the
jack/stateful-sig-tree-cache
branch
from
December 1, 2026 23:06
1c474f5 to
2d86868
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For both HSS and XMSS very significant gains can come from storing various intermediate values in the Merkle tree. These must be rewritten as part of the private key after the next index, but we already require this in order to increment the index itself.
These changes improve performance of XMSS and HSS signature generation by several orders of magnitude (eg HSS-LMS-SHA-256,HW(10,1) signing goes from 85 sign/s to 23000 sign/s). In general HSS-LMS and XMSS signing were roughly the same cost as keygen, and this change decouples this. Now even XMSS H=20 signatures take under 1ms.
As a precaution, HSS and XMSS hash signatures are verified before release.