From 9d130b0a28f601b15ca928e990ce26bb242e0a2a Mon Sep 17 00:00:00 2001 From: Emman Date: Tue, 19 Jan 2021 14:34:46 +0800 Subject: [PATCH] MAGIC - add benchmark test result --- README.md | 8 ++++++++ sm2/p256.go | 24 ++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 3e28739..d35171c 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,14 @@ PASS ok gmsm/sm2 5.629s + P-256/SM2(with P256/SM2 curve implementation, first version) + 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 + P-256 goos: windows goarch: amd64 diff --git a/sm2/p256.go b/sm2/p256.go index c1b8ddf..13af9c3 100644 --- a/sm2/p256.go +++ b/sm2/p256.go @@ -547,18 +547,18 @@ func p256ReduceDegree(out *[p256Limbs]uint32, tmp [17]uint64) { // // Word: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 // 29 28 29 29 29 29 29 28 28 28 28 28 28 28 28 28 - // 28 29 28 29 28 29 28 29 28 29 28 29 28 29 - // 29 28 28 28 29 28 29 28 29 28 29 28 29 - // 29 28 29 28 29 29 29 29 29 29 29 29 29 - // 28 29 29 29 28 29 28 29 28 29 28 - // 28 29 28 29 28 29 28 29 28 29 - // 29 28 29 28 29 28 29 28 29 - // 29 28 28 29 29 29 29 29 29 - // 28 29 28 28 28 28 28 - // 28 29 28 29 28 29 - // 29 28 29 28 29 - // 29 28 29 28 29 - // 29 28 29 + // 28 29 28 29 28 29 28 29 28 29 28 29 28 29 + // 29 28 28 28 29 28 29 28 29 28 29 28 29 + // 29 28 29 28 29 29 29 29 29 29 29 29 29 + // 28 29 29 29 28 29 28 29 28 29 28 + // 28 29 28 29 28 29 28 29 28 29 + // 29 28 29 28 29 28 29 28 29 + // 29 28 28 29 29 29 29 29 29 + // 28 29 28 28 28 28 28 + // 28 29 28 29 28 29 + // 29 28 29 28 29 + // 29 28 29 28 29 + // 29 28 29 // 29 // ------------------------------------------------- // according the table, from tmp2[6] to tmp[14], consider their initial value,