Skip to content

Implement SHA3-256, SHA3-512, SHAKE128 and SHAKE256#173

Open
ctz wants to merge 1 commit into
jbp-cpp-and-s2n-bignumfrom
jbp-sha3
Open

Implement SHA3-256, SHA3-512, SHAKE128 and SHAKE256#173
ctz wants to merge 1 commit into
jbp-cpp-and-s2n-bignumfrom
jbp-sha3

Conversation

@ctz
Copy link
Copy Markdown
Owner

@ctz ctz commented Apr 30, 2026

No description provided.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 30, 2026

Merging this PR will not alter performance

✅ 155 untouched benchmarks


Comparing jbp-sha3 (18d2cae) with jbp-cpp-and-s2n-bignum (02bcb4a)

Open in CodSpeed

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

❌ Patch coverage is 99.44186% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.76%. Comparing base (02bcb4a) to head (18d2cae).

Files with missing lines Patch % Lines
graviola/src/mid/sha3.rs 97.79% 6 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           jbp-cpp-and-s2n-bignum     #173      +/-   ##
==========================================================
- Coverage                   99.77%   99.76%   -0.01%     
==========================================================
  Files                         184      187       +3     
  Lines                       51360    52435    +1075     
==========================================================
+ Hits                        51242    52311    +1069     
- Misses                        118      124       +6     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds SHA-3 family hashing support to Graviola by introducing mid-level SHA3-256/SHA3-512 contexts and SHAKE128/SHAKE256 XOFs backed by Keccak-f1600 implementations in the low-level arch modules.

Changes:

  • Introduce mid::sha3 with SHA3-256/SHA3-512 incremental hashing and SHAKE128/SHAKE256 incremental output APIs.
  • Add Keccak-f1600 permutation implementations for x86_64 and aarch64, and wire them into low.
  • Extend the asm parsing tooling and update README/module exports to surface SHA3 support.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
graviola/src/mid/sha3.rs New SHA3/SHAKE sponge implementation + tests.
graviola/src/mid/mod.rs Expose sha3 module in mid layer.
graviola/src/low/x86_64/sha3_keccak_f1600.rs New generated Keccak-f1600 x86_64 asm wrapper.
graviola/src/low/x86_64/mod.rs Register x86_64 Keccak-f1600 module.
graviola/src/low/mod.rs Re-export sha3_keccak_f1600 for supported arches.
graviola/src/low/generic/blockwise.rs Add Blockwise::add helper used by SHA3 padding.
graviola/src/low/aarch64/sha3_keccak_f1600.rs New generated Keccak-f1600 aarch64 asm wrapper.
graviola/src/low/aarch64/mod.rs Register aarch64 Keccak-f1600 module.
graviola/src/lib.rs Re-export mid::sha3 under hashing.
admin/parse-asm/parse.py Add new CFI macro expansions used by SHA3 asm parsing.
admin/parse-asm/driver.sha3.py New driver to generate Rust asm wrappers for Keccak-f1600.
README.md Mark SHA3/SHAKE as implemented.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread graviola/src/mid/sha3.rs Outdated
Comment thread graviola/src/mid/sha3.rs
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