Skip to content

use hardware AES & SHA intrinsics on ARMv8#185

Open
ara4n wants to merge 1 commit into
mainfrom
matthew/aes-sha-intrinsics
Open

use hardware AES & SHA intrinsics on ARMv8#185
ara4n wants to merge 1 commit into
mainfrom
matthew/aes-sha-intrinsics

Conversation

@ara4n

@ara4n ara4n commented Jun 24, 2026

Copy link
Copy Markdown
Member

The tantivy encrypted index code defaults to software AES and SHA on Apple Silicon (ARMv8) unless you explicitly pass in the right RUSTFLAGS and enable the asm feature on sha2. This then runs 10-20x slower (aka uses 10-20x more CPU) than the hardware primitives.

Fixes bits of element-hq/element-web#32119

@uhoreg

uhoreg commented Jun 25, 2026

Copy link
Copy Markdown
Member

Looks like sha2 v0.11 removes the asm feature flag, while sha2 v0.10.6 added some aarch64 performance improvements without requiring the asm flag. So it may be worth seeing if updating to the latest version of the sha2 crate fixes the issue. (v0.10 renames some things, and v0.11 bumps the minimum supported rust version).

@richvdh richvdh left a comment

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.

per hubert's review.

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