2021-02-16 20:25:44 +08:00
|
|
|
|
|
|
|
# GM-Standards SM2/SM3/SM4 for Go
|
|
|
|
|
2021-02-16 20:33:50 +08:00
|
|
|
[](https://travis-ci.org/emmansun/gmsm) [](https://godoc.org/github.com/emmansun/gmsm) [](https://github.com/emmansun/gmsm/releases)
|
2021-02-16 20:25:44 +08:00
|
|
|
|
2021-02-12 12:27:22 +08:00
|
|
|
This is a **SM2 sm2p256v1** implementation whose performance is similar like golang native NIST P256 under **amd64** .
|
2021-02-10 15:07:00 +08:00
|
|
|
|
2021-02-22 16:02:22 +08:00
|
|
|
For implementation detail, please refer https://github.com/emmansun/gmsm/wiki
|
2021-02-22 16:01:33 +08:00
|
|
|
|
2020-12-17 11:15:27 +08:00
|
|
|
**SM2 encryption Benchmark**
|
2020-12-17 11:11:49 +08:00
|
|
|
|
2020-12-17 11:15:47 +08:00
|
|
|
P-256/SM2(No tuning)
|
2020-12-17 11:15:27 +08:00
|
|
|
goos: windows
|
|
|
|
goarch: amd64
|
|
|
|
pkg: gmsm/sm2
|
|
|
|
BenchmarkLessThan32-6 210 5665861 ns/op 0.01 MB/s 2601864 B/op 27725 allocs/op
|
|
|
|
PASS
|
|
|
|
ok gmsm/sm2 5.629s
|
|
|
|
|
2021-02-10 15:35:03 +08:00
|
|
|
P-256/SM2(with P256/SM2 curve pure golang implementation)
|
2021-01-19 14:34:46 +08:00
|
|
|
goos: windows
|
|
|
|
goarch: amd64
|
|
|
|
pkg: gmsm/sm2
|
|
|
|
BenchmarkLessThan32_P256SM2-6 1027 1169516 ns/op 3874 B/op 74 allocs/op
|
|
|
|
PASS
|
|
|
|
ok gmsm/sm2 1.564s
|
|
|
|
|
2021-02-11 12:11:43 +08:00
|
|
|
P-256/SM2(with P256/SM2 amd64 curve implementation, i think there are still improvement space for p256Sqr function)
|
|
|
|
goos: windows
|
2021-02-10 11:24:20 +08:00
|
|
|
goarch: amd64
|
|
|
|
pkg: github.com/emmansun/gmsm/sm2
|
|
|
|
BenchmarkLessThan32_P256SM2-6 10447 115618 ns/op 2357 B/op 46 allocs/op
|
|
|
|
PASS
|
|
|
|
ok github.com/emmansun/gmsm/sm2 2.199s
|
|
|
|
|
2021-02-10 15:35:03 +08:00
|
|
|
P-256 (SM2 based on NIST P-256 curve)
|
2020-12-17 11:15:27 +08:00
|
|
|
goos: windows
|
|
|
|
goarch: amd64
|
|
|
|
pkg: gmsm/sm2
|
|
|
|
BenchmarkMoreThan32-6 13656 86252 ns/op 3141 B/op 50 allocs/op
|
|
|
|
PASS
|
|
|
|
ok gmsm/sm2 4.139s
|
2021-03-08 12:20:40 +08:00
|
|
|
|
|
|
|
**SM3 hash Benchmark**
|
|
|
|
|
|
|
|
Pure golang version
|
|
|
|
goos: windows
|
|
|
|
goarch: amd64
|
|
|
|
pkg: github.com/emmansun/gmsm/sm3
|
|
|
|
BenchmarkHash8K-6 27097 41112 ns/op 199.26 MB/s 0 B/op 0 allocs/op
|
|
|
|
PASS
|
|
|
|
ok github.com/emmansun/gmsm/sm3 3.463s
|
|
|
|
|
|
|
|
ASM (non-AVX2) version
|
|
|
|
goos: windows
|
|
|
|
goarch: amd64
|
|
|
|
pkg: github.com/emmansun/gmsm/sm3
|
2021-03-09 11:36:35 +08:00
|
|
|
BenchmarkHash8K-6 35080 33235 ns/op 246.49 MB/s 0 B/op 0 allocs/op
|
2021-03-08 12:20:40 +08:00
|
|
|
PASS
|
2021-03-09 11:36:35 +08:00
|
|
|
ok github.com/emmansun/gmsm/sm3 3.102s
|