Re: [PR] Add PQC (ML-DSA and ML-KEM) support for XML Dig ital Signature and Enc… [santuario-xml-security-java]

Arpan0995 (via GitHub) <[email protected]>
Newsgroups gmane.text.xml.security.devel
Message-ID <PR_kwDOD7oF9878HQFs-a99ee0ae-57f8-4017-b430-e34166124523@gitbox.apache.org>
Arpan0995 commented on PR #645:
URL: https://github.com/apache/santuario-xml-security-java/pull/645#issuecomment-5317670857

   I have been looking at post-quantum support across a number of Java crypto libraries and read through this PR with interest. Two choices in the KEM path stood out as the right ones: it takes the encapsulation length from the KEM API (Decapsulator.encapsulationSize()) rather than a hardcoded per-algorithm table, and it derives the key-wrap key through a KDF rather than using the raw shared secret.
   
   One gap I noticed while reading the tests. The new PQC tests (XMLSignatureMLDSATest, XMLEncryptionMLKEMTest, StaxMLDSASignatureTest, StaxMLKEMEncryptionTest) all exercise the happy path only, sign-then-verify and encrypt-then-decrypt. For a signature and encryption feature it would be worth adding a few negative cases that lock in the security-relevant behaviour, for example:
   
   - a tampered ML-DSA signature (a flipped byte of SignatureValue) is rejected by verification;
   - an ML-DSA signature checked against the wrong public key fails;
   - ML-KEM decryption with the wrong recipient private key fails cleanly rather than returning wrong plaintext;
   - a truncated or corrupted KEM encapsulation (shorter than encapsulationSize, or a flipped byte) is rejected with a clear exception.
   
   These are the cases that would catch a regression in the verify or decapsulate path later, and they are quick to add on top of the round-trip tests already there. Since you are planning to split this into separate Signature and Encryption PRs, the ML-DSA cases would go with the signature side and the ML-KEM cases with the encryption side. Happy to help with any of them if useful.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.