Feature/winternitz ots - #7621
Merged
Merged
Conversation
dilaraacetin
requested review from
DenizAltunkapan,
alxkm and
yanglbme
as code owners
September 27, 2026 11:58
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7621 +/- ##
============================================
+ Coverage 81.46% 81.49% +0.03%
- Complexity 8053 8079 +26
============================================
Files 835 836 +1
Lines 25387 25466 +79
Branches 4950 4966 +16
============================================
+ Hits 20681 20754 +73
- Misses 3921 3924 +3
- Partials 785 788 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
alxkm
approved these changes
Sep 27, 2026
alxkm
left a comment
Member
There was a problem hiding this comment.
Looks good. Thank you for the contribution.
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.
Fixes #7620
What does this PR add?
This PR adds a Winternitz One-Time Signature (WOTS) implementation, the
size-optimized evolution of the recently added Lamport signature and the actual
building block of modern post-quantum signature standards such as XMSS (RFC 8391)
and SPHINCS+ (FIPS 205).
Implementation details
WinternitzSignature.java— self-contained, no external dependencies(
java.security.MessageDigest+SecureRandomonly)w ∈ {4, 16, 256}(default 16); chain countslen1,len2,lenare derived fromwrather than hard-coded(e.g.
w=16 → len1=64, len2=3, len=67)signandverifyvia a single helper to guarantee symmetrythrows
IllegalStateExceptionnull/malformed inputs and unsupported
wvaluesTests
WinternitzSignatureTest.javacovers: valid signature verification for eachsupported
w(parameterized), chain-count derivation, tampered message andtampered signature rejection, wrong key pair and mismatched
wrejection,one-time enforcement, null/invalid inputs, empty and multi-KB messages, and
immutability of returned key material.
Javadocs explain the algorithm, the role of the Winternitz parameter and the
checksum, why the scheme is quantum-resistant, the one-time limitation, and
include a
@seereference toLamportSignatureplus a Wikipedia link. Theimplementation is for educational purposes only.
clang-format -i --style=file path/to/your/file.java