Skip to content

Sign a 64-byte mu in testAllSigs for ML-DSA-*-extmu - #36

Merged
dstebila merged 2 commits into
masterfrom
ds-fix-extmu-test
Nov 3, 2026
Merged

dstebila merged 2 commits into
masterfrom
ds-fix-extmu-test

Conversation

@dstebila

@dstebila dstebila commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

CI builds against liboqs main, which enables ML-DSA-44-extmu, ML-DSA-65-extmu and ML-DSA-87-extmu by default. These variants sign an externally computed 64-byte μ rather than an arbitrary message, and liboqs rejects any other message length. testAllSigs signs the same 27-byte message with every enabled algorithm, so these three cases fail, and so does mvn package.

This PR signs a random 64-byte μ for algorithms whose name ends in -extmu, as liboqs's own tests/test_sig.c does. Only the test changes.

Testing

Tested locally on macOS (arm64, JDK 27) against liboqs main (8c41c85). mvn package passes with 317 tests and 0 errors, where master has 3 errors, and the examples compile.

On master, these failures show up as an ArrayIndexOutOfBoundsException with a garbage length rather than RuntimeException: Cannot sign message, because sign leaves the signature length uninitialized when signing fails. #37 fixes that.

🤖 Generated with Claude Code

liboqs enables ML-DSA-44-extmu, ML-DSA-65-extmu and ML-DSA-87-extmu by
default. They sign an externally computed 64-byte mu rather than an
arbitrary message, and reject any other message length. testAllSigs
signed the same 27-byte message with every enabled algorithm, so it
failed for these three, and mvn package failed against liboqs main.

Sign a 64-byte mu for the extmu variants, as liboqs's own test_sig.c
does.

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An all-zero mu would not catch the wrapper passing a zeroed buffer to
liboqs instead of the caller's bytes. Use random bytes, as liboqs's
test_sig.c does.

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dstebila dstebila self-assigned this Nov 2, 2026
@dstebila

dstebila commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@jimouris Do you have still have an interest in liboqs-java? If so, there is this and two other PRs making some updates that I would appreciate a review on.

@jimouris

jimouris commented Nov 3, 2026

Copy link
Copy Markdown
Member

Hi @dstebila, for sure. I'll check all three of them soon!

@jimouris jimouris left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dstebila
dstebila merged commit 3c95cbb into master Nov 3, 2026
10 checks passed
@dstebila
dstebila deleted the ds-fix-extmu-test branch November 3, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants