Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Add ACVP test framework for ML-DSA #2068

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jakemas
Copy link
Contributor

@jakemas jakemas commented Dec 18, 2024

Issues:

Resolves #CryptoAlg-2819

Description of changes:

Implements:

Call-outs:

Had to make some changes to:

  • ml_dsa.c/h make the seed rnd a const
  • export and extern parameter set up functions (so we can use them in the module wrapper)

Testing:

Confirmed passing ACVP test vector live server

2024/12/18 21:16:35 Loaded 40 cached tokens
2024/12/18 21:16:35 Uploading result for "/acvp/v1/testSessions/XXXXXX/vectorSets/XXXXXXX"
2024/12/18 21:16:35 Result size 877139 bytes
2024/12/18 21:16:36 Uploading result for "/acvp/v1/testSessions/XXXXXX/vectorSets/XXXXXXX"
2024/12/18 21:16:36 Result size 210609 bytes
2024/12/18 21:16:37 Uploading result for "/acvp/v1/testSessions/XXXXXX/vectorSets/XXXXXXX"
2024/12/18 21:16:37 Result size 5235 bytes
2024/12/18 21:16:38 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:16:48 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:16:59 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:17:09 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:17:19 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:17:29 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:17:39 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:17:50 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:18:00 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:18:10 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:18:20 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:18:31 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:18:41 Server hasn't finished processing results. Waiting 10 seconds.
2024/12/18 21:18:51 Test passed

Confirmed passing

/Applications/CLion.app/Contents/bin/cmake/mac/aarch64/bin/cmake --build /acvp/aws-lc/cmake-build-debug --target acvp_tests -j 10
2024/12/18 14:22:36 40 ACVP tests matched expectations
2024/12/18 14:22:37 1 ACVP tests matched expectations
2024/12/18 14:22:38 1 ACVP tests matched expectations
2024/12/18 14:22:40 1 ACVP tests matched expectations
2024/12/18 14:22:42 1 ACVP tests matched expectations
2024/12/18 14:22:44 1 ACVP tests matched expectations
2024/12/18 14:22:46 1 ACVP tests matched expectations
2024/12/18 14:22:49 1 ACVP tests matched expectations
2024/12/18 14:22:51 1 ACVP tests matched expectations
2024/12/18 14:23:12 1 ACVP tests matched expectations
2024/12/18 14:23:14 1 ACVP tests matched expectations
2024/12/18 14:23:15 1 ACVP tests matched expectations
2024/12/18 14:23:16 1 ACVP tests matched expectations
2024/12/18 14:23:17 1 ACVP tests matched expectations

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

"revision": "FIPS204",
"parameterSets": ["ML-DSA-44", "ML-DSA-65", "ML-DSA-87"],
"deterministic": [false],
"messageLength": [{"min": 8, "max": 65536", "increment": 8}]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"messageLength": [{"min": 8, "max": 65536", "increment": 8}]
"messageLength": [{"min": 8, "max": 65536, "increment": 8}]

Copy link
Contributor Author

@jakemas jakemas Dec 18, 2024

Choose a reason for hiding this comment

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

Thank you, good spot -- that's a bug in the standard too, so I'll let the working group know! Addressed in b9ecf31

@jakemas
Copy link
Contributor Author

jakemas commented Dec 18, 2024

Failing builds are because of ENABLE_DILITHIUM flag set to 0. We can add ifdef around the modulewrapper ML-DSA specific code to fix this. The merging of #2034 will help more of the CI pass, but ultimately this flag will be removed.

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.77%. Comparing base (d0501c5) to head (18bc528).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2068   +/-   ##
=======================================
  Coverage   78.76%   78.77%           
=======================================
  Files         598      598           
  Lines      103703   103703           
  Branches    14735    14735           
=======================================
+ Hits        81685    81689    +4     
+ Misses      21364    21362    -2     
+ Partials      654      652    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

3 participants