cryptogm

command module
v0.0.0-...-a492c9f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2023 License: BSD-3-Clause Imports: 0 Imported by: 0

README

cryptogm in golang

Build Status

An implementation of china crypto standards written in golang. This package includes sm2,sm3,sm4 and sm9 algorithms. Some algorithms have been optimized using AVX2 instructions.

Install

go get github.com/triplewz/cryptogm

Benchmark

CPU: intel core i7-7700 @3.6GHz.

sm2

BenchmarkSign-8               	   	     19392 ns/op 
BenchmarkVerify-8             	   	     30326 ns/op 
BenchmarkSignWithDigest-8     	   	     16701 ns/op 
BenchmarkVerifyWithDigest-8   	   	     26742 ns/op 
BenchmarkSignWithASN1-8       	   	     21251 ns/op 
BenchmarkVerifyWithASN1-8     	   	     30390 ns/op 

sm3

BenchmarkHash8Bytes-8   	 220   ns/op	      36.44  MB/s
BenchmarkHash1K-8       	 2815  ns/op	      363.71 MB/s
BenchmarkHash8K-8       	 20422 ns/op	      401.13 MB/s

sm4

BenchmarkSm4Ecb8Bytes-8       	623   ns/op	  12.83  MB/s
BenchmarkSm4Ecb1K-8             10526 ns/op	  97.29  MB/s
BenchmarkSm4Ecb8K-8        	80692 ns/op	  101.52 MB/s
BenchmarkSm4Cbc8Bytes-8         664   ns/op	  12.05  MB/s
BenchmarkSm4Cbc1K-8             12299 ns/op	  83.26  MB/s
BenchmarkSm4Cbc8K-8             95395 ns/op	  85.87  MB/s

sm9

BenchmarkSign-8                      543           2187579 ns/op
BenchmarkVerify-8                    338           3599817 ns/op

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
elliptic
sm2curve
Package elliptic implements several standard elliptic curves over prime fields.
Package elliptic implements several standard elliptic curves over prime fields.
sm9curve
Package bn256 implements a particular bilinear group.
Package bn256 implements a particular bilinear group.
sm
sm2
Package sm2 implements china crypto standards.
Package sm2 implements china crypto standards.
sm3
sm4
sm9

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL