Skip to content

ML-DSA: Add optional context to signing and verification#90

Open
mjdemilliano wants to merge 3 commits intowolfSSL:masterfrom
mjdemilliano:ml-dsa-sign-with-context
Open

ML-DSA: Add optional context to signing and verification#90
mjdemilliano wants to merge 3 commits intowolfSSL:masterfrom
mjdemilliano:ml-dsa-sign-with-context

Conversation

@mjdemilliano
Copy link
Copy Markdown
Contributor

No description provided.

@embhorn
Copy link
Copy Markdown
Member

embhorn commented Apr 7, 2026

@mjdemilliano is an approved contributor

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds optional “context” (ctx) support to ML-DSA (Dilithium) signing and verification, enabling domain separation when using the wolfSSL context-aware APIs.

Changes:

  • Extend MlDsaPrivate.sign() and _MlDsaBase.verify() with an optional ctx argument and route to *_ctx_msg wolfCrypt APIs when provided.
  • Add tests covering sign/verify behavior with correct/incorrect context.
  • Extend the CFFI bindings to include wc_dilithium_sign_ctx_msg and wc_dilithium_verify_ctx_msg.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
wolfcrypt/ciphers.py Adds ctx parameter and switches between ctx/non-ctx wolfCrypt functions.
tests/test_mldsa.py Adds coverage for context-aware signing and verification.
scripts/build_ffi.py Declares the new ctx-aware wolfCrypt APIs in the FFI cdef.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@danielinux danielinux assigned danielinux and unassigned wolfSSL-Bot Apr 8, 2026
Copy link
Copy Markdown
Member

@danielinux danielinux left a comment

Choose a reason for hiding this comment

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

Please address copilot's commends

@mjdemilliano
Copy link
Copy Markdown
Contributor Author

Addressed Copilot comments.

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.

6 participants