Add external-mu (extmu) support to Signature wrapper and tests#154
Open
dstebila wants to merge 1 commit into
Open
Add external-mu (extmu) support to Signature wrapper and tests#154dstebila wants to merge 1 commit into
dstebila wants to merge 1 commit into
Conversation
liboqs enables the ML-DSA external-mu variants (ML-DSA-{44,65,87}-extmu),
which reuse the standard sign/verify C API but interpret the signed input as
the externally computed mu rather than a raw message.
- Add an is_extmu flag (instance attribute + details) derived from the
algorithm name, and document the external-mu input semantics on
sign()/verify(). The signing API stays uniform and algorithm-agnostic,
matching liboqs (which exposes no dedicated external-mu function and no
runtime mu length).
- Parametrize the generic sign/verify tests to use a 64-byte message for
extmu variants (mirroring liboqs's test_sig.c) and drop the "extmu"
stopgap from disabled_sig_patterns (added in #152).
- Add test_is_extmu_flag covering the new flag.
Closes #151.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
Member
Author
|
@bhess @abhi-dev-engg Here's a PR that adds external-mu support to liboqs-python. Since you were involved in designing this for liboqs, I'd appreciate your feedback. |
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.
Adds first-class support for the ML-DSA external-mu variants (
ML-DSA-44-extmu,ML-DSA-65-extmu,ML-DSA-87-extmu) that liboqs now enables, replacing the temporary test skip from #152.Background
externalMu is the FIPS 204 (Algorithm 7) option to supply the message representative µ from a separate cryptographic module instead of a raw message. In liboqs this was added in open-quantum-safe/liboqs#2366, following the design discussion in open-quantum-safe/liboqs#2254.
API design rationale
The liboqs design deliberately reuses the existing sign/verify API rather than introducing a dedicated function. From #2254, the maintainer's chosen approach (Option 1) is to "reuse the existing signing API and interpret the message input as
mufor these variants", explicitly rejecting a newOQS_SIG_sign_with_external_mubecause "externalMu is algorithm-specific" and "adding a new global API is difficult to justify." Accordingly:sign()/verify()already work for extmu; the caller simply passes the externally computed µ as the "message".OQS_SIG_ml_dsa_44_extmu_length_mu = 64) and enforces its own 64-byte check internally.This PR mirrors that philosophy in the Python wrapper — keeping the signing API uniform and algorithm-agnostic instead of re-encoding a per-algorithm crypto constant:
is_extmuflag (instance attribute +details) so callers can detect external-mu variants.sign()/verify()that for extmu variants the input is the externally computed µ.oqs.py— length validation is left to liboqs.Tests
tests/test_sig.c(which likewise hardcodes 64 in test code). This restores full correctness / wrong-message / wrong-signature / wrong-public-key coverage for the extmu variants."extmu"entry fromdisabled_sig_patterns(the Skip extmu ML-DSA variants in generic signature tests #152 stopgap).test_is_extmu_flag.Verified locally against a liboqs build with the extmu variants enabled.
Closes #151.
🤖 Generated with Claude Code