This repository has been archived by the owner. It is now read-only.
An AVX/AVX2/x64/pure-Go implementation of the ChaCha20 stream cipher for Golang. [Deprecated].
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
internal
.travis.yml
LICENSE
README.md
avx_amd64.s
chacha20.go
chacha20_amd64.go
chacha20_avx.pl
chacha20_avx2.pl
chacha20_avx2_amd64.s
chacha20_avx_amd64.s
chacha20_ref.go
chacha20_test.go
chacha20_x64.pl
chacha20_x64_amd64.s
hchacha20_x64.pl
hchacha20_x64_amd64.s
shootout_test.go
x86_64-xlate.pl

README.md

chacha20

GoDoc Build Status

Deprecated: This is a legacy implementation. New users should use aead/chacha20 instead.

An AVX/AVX2/x64/pure-Go implementation of the ChaCha20 stream cipher for Golang.

The AVX and AVX2 ChaCha20 implementations were taken from cloudflare/sslconfig.

The x64 ChaCha20 implementations was taken from the public domain sources in SUPERCOP.

The pure Go ChaCha20 implementation was taken from codahale/chacha20.

Benchmark

BenchmarkChaCha20Codahale/1M-8	     200	   5951390 ns/op	 176.19 MB/s	[codahale/chacha20]
BenchmarkChaCha20AEAD/1M-8    	    2000	    771361 ns/op	1359.38 MB/s	[aead/chacha20]
BenchmarkChaCha20Go/1M-8      	     300	   5638541 ns/op	 185.97 MB/s	[tmthrgd/chacha20/internal/ref]
BenchmarkChaCha20x64/1M-8     	    2000	    927749 ns/op	1130.24 MB/s	[tmthrgd/chacha20]
BenchmarkChaCha20AVX/1M-8     	    2000	    730687 ns/op	1435.05 MB/s	[tmthrgd/chacha20]
BenchmarkAESCTR/1M-8          	     500	   2600296 ns/op	 403.25 MB/s	[crypto/aes crypto/cipher]
BenchmarkAESGCM/1M-8          	    2000	    864448 ns/op	1213.00 MB/s	[crypto/aes crypto/cipher]
BenchmarkRC4/1M-8             	    1000	   1332092 ns/op	 787.16 MB/s	[crypto/rc4]

License

Unless otherwise noted, the chacha20 source files are distributed under the Modified BSD License found in the LICENSE file.

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/)