Skip to content

Implement remaining aarch64 SHA-3 LLVM intrinsics#1666

Merged
bjorn3 merged 1 commit into
rust-lang:mainfrom
CathalMullan:sha3
Jul 3, 2026
Merged

Implement remaining aarch64 SHA-3 LLVM intrinsics#1666
bjorn3 merged 1 commit into
rust-lang:mainfrom
CathalMullan:sha3

Conversation

@CathalMullan

@CathalMullan CathalMullan commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Implements the remaining SHA-3 intrinsics.

Needed for ML-KEM / ML-DSA support.
graviola has a feature flag which makes use of libcrux for PQC. Those tests aren't currently run, but can be enabled in the future (once a few more missing intrinsics are added). - No longer the case, graviola switched to a native ML-KEM implementation.

Comment on lines +1022 to +1023
let band_not = fx.bcx.ins().band_not(b_lane, c_lane);
fx.bcx.ins().bxor(a_lane, band_not)

@bjorn3 bjorn3 Jul 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't this supposed to be b ^ (a & !c) rather than a ^ (b & !c)?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think the current order is right. Testing against stdarch, b ^ (a & !c) results in 8 failing vbcaxq tests, while the current approach passes all.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, the instruction is bcax d, n, m, a, but the operation in the docs lists the operands as m, n, a, which indeed results in a ^ (b & !c) as correct order.

@bjorn3 bjorn3 merged commit a6618fe into rust-lang:main Jul 3, 2026
24 checks passed
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