Skip to content

Commit

Permalink
Update 04-testtypes.adoc
Browse files Browse the repository at this point in the history
  • Loading branch information
celic authored Aug 13, 2024
1 parent cdfd23e commit 2f786fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ml-dsa/sections/04-testtypes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The tests described in this document have the intention of ensuring an implement

Within ML-DSA sigGen, the algorithm enters a loop until a valid signature is found. The loop contains four potential reasons to reject a candidate signature: if the z infinity norm is too large, if the r infinity norm is too large, if there are too many hints in h, or if the ct0 infinity norm is too large. These conditions occur at various rarities that can make it difficult to test each error condition with randomized testing. If an implementation adheres strictly to the pseudocode in <<FIPS204>>, the following table provides helpful known answer tests that trigger each rejection case exactly once. If the implementation varies from the psuedocode, it would be prudent to use a debugger to ensure that all rejection cases are triggered by testing. To save on space, the table will provide the seed used to generate the key pair, and a hash of the keys, SHA2-256(pk || sk). A hash of the resulting signature is also provided, SHA2-256(sig). All cases are defined using the deterministic signature method. Note that the ct0 infinity norm check only applies to ML-DSA-44. This condition is not possible on the other security levels. Thanks to Qinglai Xiao and Mike Hamburg (Rambus Inc) for providing code to generate these test cases; more information on their technique is available on the NIST PQC-Forum <<PQCForum>>.

NOTE: The following table was generated using a draft version of FIPS 204. To regenerate the correct key from the seed provided, a change to Algorithm 6 ML-DSA.KeyGen_internal is required. Line 1 should read `<- H(xi, 128)` where `xi` is the seed.
NOTE: The following table was generated using a draft version of FIPS 204. To regenerate the intended key from the seed provided, a change to Algorithm 6 ML-DSA.KeyGen_internal is required. Starting from FIPS 204, Algorithm 6, Line 1 should instead read `H(xi, 128)` where `xi` is the seed. This is only a temporary change to allow users to correctly regenerate this table.

[[kats_table]]
.ML-DSA sigGen Known Answer Tests for Rejection Cases
Expand Down Expand Up @@ -63,4 +63,4 @@ NOTE: The following table was generated using a draft version of FIPS 204. To re
| ML-DSA-44 | B6AA3BA3B3289E2484B7AD76AD17C7B86CEAE632C11B43E4C0826543FFC68054 | 673D01FED88C527B29A7ADC26F9C73EA352EB4337E5A20670BF331AE7250025E | BE77A2BFA9E5F0F03794877AF73DA495D0C3A809EB365A5DE5490C3A4B4FBC90 | BEEA3888AF937E011A8D771F451A394255670E303E507F460289B0B019CE470C
| ML-DSA-44 | C53FB3949EFEB05FABA206F5A6E2B4D214C36454C55FA38F3F571BF1AB83A8AC | 3423708B762452EA34E4A175C55DC05EDD7766B49C7832EFB2B51E03BB73DF27 | 5D1D4555CF47B8F53F8F8C325A2C18F40AA542E81CFBA51D6C26127F4A5F07BF | B7B6F02F216AF4B173CFA2468EC1570C0B1C7903CC5E7B15FA78D5FA5263FF04
| ML-DSA-44 | D9BAC8AC09213F46358B7EF7EB0D9CAFC5492A4A473A01BC6D708E4D8459881A | 5AF1DAB893662B90F8DC13AA4C0180610F20F33CDF56EFB4F7F63D26C857AFCC | FF05D333B0F908E839DCB8B2D02BBE8864048355EF838CE413701D9B5FFE8B22 | 5C882CE4205F9214DCB1ACB4B4F8DFE31D3A49B6DD202BFF10B7FCC446CC50AA
|===
|===

0 comments on commit 2f786fa

Please sign in to comment.