RustCrypto / utils

Utility crates used in RustCrypto
450 stars 130 forks source link

cpufeatures: add support for DIT detection on Apple silicon #1100

Closed tarcieri closed 3 months ago

tarcieri commented 3 months ago

Adds support for detecting Data Independent Timing (DIT) support which is available on Apple silicon (e.g. M1/M2/M3).

This uses the hw.optional.arm.FEAT_DIT sysctl for detection.

For more information, see:

https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Enable-DIT-for-constant-time-cryptographic-operations

tarcieri commented 3 months ago

Note: I locally verified this was able to detect DIT on an M1