Repository navigation
Fix Apple arm64 crypto feature detection - #1375
Open
Coralesoft wants to merge 1 commit into
Open
Coralesoft wants to merge 1 commit into
Coralesoft wants to merge 1 commit into
Conversation
Detection only matched "Apple M1", leaving other Apple arm64 devices on the software paths. Enable AES, SHA-1, SHA-256 and PMULL on Apple arm64, and use sysctl to check for CRC32, SHA-3 and SHA-512. Refs weidai11#1373
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature detection only matched the brand string
Apple M1, leaving other Apple Silicon Macs and arm64 iOS devices on the software AES, SHA-1, SHA-256 and PMULL paths. CPU feature probes are disabled on Apple, so there was no fallback detection.Enable those features on Apple arm64 and use
hw.optionalsysctls for CRC32, SHA-3 and SHA-512, retaining the older sysctl names as fallbacks. Remove the unused architecture checks and guard the remaining machine-info helper for PowerPC.The same detection change passed macOS arm64 CI. AES, PMULL, SHA-1 and SHA-256 were detected, and CRC32, SHA-3 and SHA-512 matched the runner’s sysctls. I haven’t tested it locally on Apple hardware.
Thanks to @mega-wli for the report and analysis.
Refs #1373.