-
Notifications
You must be signed in to change notification settings - Fork 64
Armv8.2 SM3和SM4
Sun Yimin edited this page Dec 29, 2021
·
31 revisions
go test -v -short -bench . -run=^$ ./...
goos: linux
goarch: arm64
pkg: github.com/emmansun/gmsm/sm3
BenchmarkHash8Bytes
BenchmarkHash8Bytes-2 2738724 438.4 ns/op 18.25 MB/s
BenchmarkHash1K
BenchmarkHash1K-2 192519 6232 ns/op 164.32 MB/s
BenchmarkHash8K
BenchmarkHash8K-2 24950 48112 ns/op 170.27 MB/s
BenchmarkHash8K_SH256
BenchmarkHash8K_SH256-2 223354 5369 ns/op 1525.81 MB/s
PASS
ok github.com/emmansun/gmsm/sm3 5.857s
和CPU指令级别的差距基本上是10倍!
找不到相关CPU环境,mark先。
- Summary of A64 cryptographic instructions
- Arm A64 Instruction Set Architecture
- linux arm64 crypto / (https://github.com/torvalds/linux/tree/master/arch/arm64/crypto)
- A Quick Guide to Go's Assembler
- Golang arm instructions mapping
- A C/C++ header file that converts Intel SSE intrinsics to Arm/Aarch64 NEON intrinsics.
- asm2go