]> Cypherpunks repositories - gostls13.git/commit
crypto/cipher, crypto/aes: add s390x implementation of AES-CTR
authorMichael Munday <munday@ca.ibm.com>
Mon, 18 Apr 2016 01:26:23 +0000 (21:26 -0400)
committerAdam Langley <agl@golang.org>
Fri, 29 Apr 2016 21:17:31 +0000 (21:17 +0000)
commitc717675c35cb436bdab62091a6288843aa1c863c
tree8ff59b094b483fac13f4071e78351842cc7295a7
parent2f8475648a5500830561ea03960a1425e1ff0993
crypto/cipher, crypto/aes: add s390x implementation of AES-CTR

This commit adds the new 'ctrAble' interface to the crypto/cipher
package. The role of ctrAble is the same as gcmAble but for CTR
instead of GCM. It allows block ciphers to provide optimized CTR
implementations.

The primary benefit of adding CTR support to the s390x AES
implementation is that it allows us to encrypt the counter values
in bulk, giving the cipher message instruction a larger chunk of
data to work on per invocation.

The xorBytes assembly is necessary because xorBytes becomes a
bottleneck when CTR is done in this way. Hopefully it will be
possible to remove this once s390x has migrated to the ssa
backend.

name      old speed     new speed     delta
AESCTR1K  160MB/s ± 6%  867MB/s ± 0%  +442.42%  (p=0.000 n=9+10)

Change-Id: I1ae16b0ce0e2641d2bdc7d7eabc94dd35f6e9318
Reviewed-on: https://go-review.googlesource.com/22195
Reviewed-by: Adam Langley <agl@golang.org>
src/crypto/aes/asm_s390x.s
src/crypto/aes/ctr_s390x.go [new file with mode: 0644]
src/crypto/aes/modes.go
src/crypto/aes/modes_test.go
src/crypto/cipher/ctr.go