]> Cypherpunks repositories - gostls13.git/commit
crypto/cipher: speed up xor operations in CBC, CFB, OBF, CTR
authorHan-Wen Nienhuys <hanwen@google.com>
Wed, 11 Dec 2013 21:05:02 +0000 (16:05 -0500)
committerAdam Langley <agl@golang.org>
Wed, 11 Dec 2013 21:05:02 +0000 (16:05 -0500)
commit5744be9fe44f77010840f52eaca1b654fd19d00d
treea570b0662f563df1ef25404861d6117d8ad25e36
parent426b48a77522c0e411cf328372bcfaae3dc7bcc9
crypto/cipher: speed up xor operations in CBC, CFB, OBF, CTR
and GCM on 386 and amd64

Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz:

benchmark                    old MB/s     new MB/s  speedup
BenchmarkAESGCMSeal1K           82.39        92.05    1.12x
BenchmarkAESGCMOpen1K           82.28        91.88    1.12x
BenchmarkAESCFBEncrypt1K       141.54       277.59    1.96x
BenchmarkAESCFBDecrypt1K       133.06       278.07    2.09x
BenchmarkAESOFB1K              160.51       380.24    2.37x
BenchmarkAESCTR1K              164.07       429.25    2.62x
BenchmarkAESCBCEncrypt1K       170.99       263.74    1.54x
BenchmarkAESCBCDecrypt1K       124.96       249.14    1.99x

Fixes #6741.

R=agl, dave, agl
CC=golang-dev
https://golang.org/cl/24250044
src/pkg/crypto/cipher/benchmark_test.go [new file with mode: 0644]
src/pkg/crypto/cipher/cbc.go
src/pkg/crypto/cipher/cfb.go
src/pkg/crypto/cipher/ctr.go
src/pkg/crypto/cipher/gcm.go
src/pkg/crypto/cipher/gcm_test.go
src/pkg/crypto/cipher/ofb.go
src/pkg/crypto/cipher/xor.go [new file with mode: 0644]
src/pkg/crypto/cipher/xor_test.go [new file with mode: 0644]