Enable SHA-256 ARM NEON acceleration on aarch64 Linux
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- cpp, linux
调研方向
Start with sha256.cpp:22 and read through sha_256_arm_v8() and the Linux runtime detection at lines 683–684. Check how the compiler handles the SHA2 intrinsics and target attribute for aarch64 Linux, then run the existing SHA-256 tests. Done means Linux aarch64 builds can use the accelerated implementation when SHA2 is detected, without calling it on unsupported hardware.
由索引模型根据 Issue 内容生成。
描述
The hardware-accelerated SHA-256 implementation (sha_256_arm_v8 using ARM SHA2 crypto extensions) is currently restricted to Apple platforms by the preprocessor guard at sha256.cpp:22:
#elif defined(__aarch64__) && defined(__APPLE__)
The Linux runtime detection code (getauxval(AT_HWCAP) & HWCAP_SHA2 at line 683) already exists inside this block but is dead code since the outer guard requires __APPLE__.
Why Apple-only
All Apple Silicon chips guarantee SHA2 extensions, so compiling the intrinsics is always safe. On Linux aarch64, older cores (e.g., Cortex-A53) may lack SHA2 support, and compiling the intrinsics without -march=armv8-a+crypto could fail.
Proposed fix
- Widen the outer guard to
#elif defined(__aarch64__) - Add
__attribute__((target("sha2")))(or+sha2target) tosha_256_arm_v8()so the compiler emits SHA instructions only for that function, regardless of the global-march - The existing
getauxvalruntime detection at line 683-684 already correctly gates whethersha_256_arm_v8is actually called at runtime
This would enable hardware SHA-256 acceleration on Linux ARM servers (AWS Graviton, Ampere Altra, etc.).
Found during security audit of cryptographic precompile code.
- 主要语言
- C++
- 星标
- 979
- 派生
- 340
- 平均合并
- 12 小时 16 分钟
- 30 天内合并 PR
- 25
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ipsilon/evmone 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 56/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 57/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 12/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 52/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 71/100
ROCm/rocm-libraries#16108 ·
维护者通常 2 天内回复
-
asr pass bug intrinsic low priority wrong result
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
👀 needs triage enhancement
难度 2/5 1-3 小时 新手友好度 72/100
rerun-io/rerun#13021 · 1 条评论 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
audit-reference-check
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复