Add ML-DSA test vectors that exercise the use_hint function with (1, 0) as input#234
Add ML-DSA test vectors that exercise the use_hint function with (1, 0) as input#234
Conversation
…nput. Reproduction case for the bug in tink-crypto/tink-go#48.
| }, | ||
| { | ||
| "type": "MlDsaVerify", | ||
| "publicKey": "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", |
There was a problem hiding this comment.
vectorlint is failing because these are currently missing publicKeyDer, the SPKI representation. (BoringSSL uses this in one of our test harnesses.)
There was a problem hiding this comment.
In a pinch you can construct it by just prepending the right prefix to each key. I believe they are:
- ML-DSA-44:
30820532300b06096086480165030403110382052100 - ML-DSA-65:
308207b2300b0609608648016503040312038207a100 - ML-DSA-87:
30820a32300b060960864801650304031303820a2100
And then to spot-check them, you can echo .... | der2ascii -hex with https://github.com/google/der-ascii
|
Ah! Thank you for generating and contributing this vector! I had been trying to get coverage for h=1, w_approx={-1, 0, 1} and had found no good way. This covers 0, any way to cover 1 and -1? Also, I had instead resorted to exhaustively testing all use_hint inputs. Could you check if https://github.com/C2SP/CCTV/tree/main/ML-DSA/accumulated#field-operation-tests would have caught this bug? |
Reproduction case for the bug in tink-crypto/tink-go#48.
These hand-crafted tests use:
t1set to all zeros,zset to all zeros.These conditions ensure that the verifier obtains a
w_approxset to all zeros.Then all hints in the signature are set to
falseexcept the first one, which ensures that a call touse_hint(1, 0)is made.w1is computed correctly by using this hint, and a consistentc_tildeis then derived and put in the signature.w1is set to all zeros instead (which is what happens when the using the buggy implementation ofuse_hintthat is fixed in mldsa: fix UseHint edge case for r0=0 per FIPS 204 Algorithm 40 tink-crypto/tink-go#48), and an inconsistentc_tildeis generated. Compliant implementations therefore reject this signature, whereas buggy ones accept it.(In other words, the difference between the valid and invalid signatures is the value of
c_tilde.)