Skip to content

Fix Apple arm64 crypto feature detection - #1375

Open
Coralesoft wants to merge 1 commit into
weidai11:masterfrom
Coralesoft:fix/issue-1373-apple-arm64-dispatch
Open

Coralesoft wants to merge 1 commit into
weidai11:masterfrom
Coralesoft:fix/issue-1373-apple-arm64-dispatch

Conversation

@Coralesoft

Copy link
Copy Markdown
Contributor

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.optional sysctls 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.

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
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.

1 participant