Coder Social home page Coder Social logo

xlcetc / cryptogm Goto Github PK

View Code? Open in Web Editor NEW
37.0 3.0 13.0 81 KB

An implement of china crypto standards, including sm2,sm3 ,sm4 and sm9 algorithms.

License: Other

Go 59.33% Assembly 38.11% C 2.56%
china-crypto-standards sm2 sm3 sm4 sm9 golang

cryptogm's Introduction

cryptogm in golang

Go

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/xlcetc/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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.