Skip to content

Releases: emmansun/gmsm

v0.18.0

24 Jun 02:36
Compare
Choose a tag to compare

Notable Changes:

  • sm9/bn256: replace gfp asm implementations.

v0.17.5

21 Jun 09:42
ecab517
Compare
Choose a tag to compare

Notable changes:

  • sm3: improve purego performance via loop unrolling, reduce assignment operations and precompute the constant rotation.
  • sm4: improve amd64 single block performance via PALIGNR instruction; improve CBC decrypt performance via reduce memory operations for both amd64 & arm64.
  • sm9/bn256: rewrite purego gfp (Add/Sub/Neg/Mul), improve performance and code readability.
  • sm9/bn256: curvePointMovCond twistPointMovCond gfP12MovCond asm implementation for amd64 & arm64.
  • build(deps): bump golang.org/x/crypto from 0.9.0 to 0.10.0

SM9 purego performance

goos: windows
goarch: amd64
pkg: github.com/emmansun/gmsm/sm9
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
BenchmarkSign-6   	     280	   4381620 ns/op	    6731 B/op	      62 allocs/op
BenchmarkVerify-6   	      62	  18846163 ns/op	   41736 B/op	     367 allocs/op
BenchmarkEncrypt-6   	     237	   4937050 ns/op	    9425 B/op	      73 allocs/op
BenchmarkDecrypt-6   	      79	  14977862 ns/op	   37644 B/op	     328 allocs/op

SM9 AMD64 performance

goos: windows
goarch: amd64
pkg: github.com/emmansun/gmsm/sm9
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
BenchmarkSign-6   	    2841	    400469 ns/op	   23117 B/op	     574 allocs/op
BenchmarkVerify-6   	     618	   1910290 ns/op	  163784 B/op	    3918 allocs/op
BenchmarkEncrypt-6   	    2352	    440718 ns/op	   24388 B/op	     582 allocs/op
BenchmarkDecrypt-6   	     721	   1557635 ns/op	  143055 B/op	    3359 allocs/op

v0.17.4

16 Jun 09:38
3cbabc3
Compare
Choose a tag to compare

Notable Changes:

  • internal/sm2ec: use MULX(Unsigned Multiply Without Affecting Flags) and AVX2 to improve performance. 使用无符号乘法指令以及AVX2提升性能。
  • internal/sm2ec: replace ScalarMult window size from 5 to 6, and reduce the scalar to [0, N-1]. Please refer #127 for detail. 解决ScalarMult实现中最后一个加法的两个点有可能相等的问题。
  • Improve sm3 sm4 pure go implementation performance. 提升sm3/4 纯go语言实现的性能。
  • sm9: get around assignment copies lock value to issue. 私钥中的主公钥改为引用,避免主公钥赋值时"assignment copies lock value"问题。
  • upgrade dependencies (golang.org/x/sys from v0.8.0 to v0.9.0). 升级依赖包。

v0.17.3

07 Jun 01:56
df8cb4d
Compare
Choose a tag to compare

Notable Changes:

  • internal/subtle/xor: use avx2 if possible
  • internal/bigmod: switch to saturated limbs and optimization for 256 bits
  • sm4: finetune bounds check
  • drbg: fix drbg prng read issue when reseed
  • smx509: properly apply name constrains to roots and intermediates
  • upgrade dependencies

v0.17.2

02 May 06:13
Compare
Choose a tag to compare

Notable Changes:

  • sm9: optimize pairing

v0.17.1

29 Apr 06:15
Compare
Choose a tag to compare

Notable Changes:

  • sm9: performance improvement: reduce mul, use addchain to gen invert/sqrt.
  • sm9: implement 1-2-6-12 towering extensions for comparison.
  • drbg: do not share hash object, but it's still NOT concurrent safe.
  • upgrade dependencies.

v0.17.0

31 Mar 03:19
7484123
Compare
Choose a tag to compare

Notable changes:

  • sm2: Make opts EncrypterOpts/DecrypterOpts/SM2SignerOption fields private, this is an incompatible change! Please use related functions to construct the opts.
  • sm3/4: A64 Cryptographic instructions (SM4EKEY/SM4EKE, SM3PARTW1/SM3PARTW2/SM3SS1/SM3TT1A/SM3TT1B/SM3TT2A/SM3TT2B) test with QEMU and bug fix.
  • pkcs7: Enable sign without attributes, legacy systems still use this approach.
  • pkcs: Fix gcm parameters marshal asn1 issue, make ICVLen(default 12) optional.
  • pkcs: SM4 OID special handling: decryption - if there are parameters, then treat it as CBC mode, otherwise ECB mode; encryption - diabled SM4 OID.

Full Changelog: v0.16.0...v0.17.0

v0.16.0

16 Mar 02:43
adec7ac
Compare
Choose a tag to compare

Notable changes:

Full Changelog: v0.15.7...v0.16.0

v0.15.7

19 Feb 02:26
35a2ebe
Compare
Choose a tag to compare

Notable changes

  • sm9: supports SM4 with ECB/CBC/CFB/OFB mode, this is incompatible change!!!
  • smx509: ParseTypedECPrivateKey, return ecdsa.PrivateKey or sm2.PrivateKey.
  • internal/bigmod: flag amd64 assembly as noescape.

v0.15.6

03 Feb 07:40
5bfdfeb
Compare
Choose a tag to compare

Notable changes

  • Add example tests for reference document
  • Upgrade dependencies
  • Change smx509.CreateCertificate method's template and parent parameter type from x509.Certificate to any