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

Switch ML-DSA to use AWS-LC SHA3 #1957

Closed
wants to merge 3 commits into from
Closed

Switch ML-DSA to use AWS-LC SHA3 #1957

wants to merge 3 commits into from

Conversation

jakemas
Copy link
Contributor

@jakemas jakemas commented Oct 30, 2024

Issues:

Resolves #CryptoAlg-2726

Description of changes:

Following the inclusion of SHAKE as an extensible-output-function (XOF) in #1839, we are now able to fully support ML-DSA with SHA3/SHAKE usage within crypto/fipsmodule. As such, all references to the internal implementation of SHA3 (within crypto/kyber/pqcrystals_dilithium_ref_common/fips202.{h|c}) have been removed.

Call-outs:

  • The structure keccak_state provided by the Kyber reference implementation has been replaced with KECCAK1600_CTX
  • The calls to absorb/update/final have been replaced with a straight swap to AWS-LC's implementation
  • The dilithium specific function dilithium_shake128_stream_init, dilithium_shake128_squeeze, dilithium_shake256_stream_init, dilithium_shake256_squeeze of fips202.c has been replaced with versions that call SHA3 from fipsmodule.

Testing:

The testing framework is the KATs for ML-DSA, and all other ML-DSA tests completed.

#CryptoAlg-2589 design documentation provides an analysis of all fips202.c usage from ML-DSA, to verify that all functionality that used to be provided by fips202.c has been replaced by this commit, the file has been removed from the library.

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.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.75%. Comparing base (39520e5) to head (b7408c2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1957      +/-   ##
==========================================
+ Coverage   78.73%   78.75%   +0.01%     
==========================================
  Files         590      590              
  Lines      101406   101406              
  Branches    14380    14380              
==========================================
+ Hits        79846    79862      +16     
+ Misses      20920    20905      -15     
+ Partials      640      639       -1     

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

@jakemas jakemas marked this pull request as ready for review October 31, 2024 01:14
@jakemas jakemas requested a review from a team as a code owner October 31, 2024 01:14
@jakemas
Copy link
Contributor Author

jakemas commented Nov 8, 2024

I'm going to have to re-base as upstream changes heavily modified sign.c in #1977

@jakemas jakemas closed this Nov 18, 2024
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.

2 participants