]> Cypherpunks repositories - gostls13.git/commit
crypto/aes: rewrite ppc64le asm-cbc routine
authorPaul E. Murphy <murp@ibm.com>
Thu, 24 Mar 2022 17:06:27 +0000 (12:06 -0500)
committerPaul Murphy <murp@ibm.com>
Mon, 14 Nov 2022 18:47:51 +0000 (18:47 +0000)
commit01d12c947c2277a46477597c2148083744ccf284
treebb47805882557839036a7b053d25c671a736b8af
parent74b6a22057b393f198d2d86f4ea7504dacf390f5
crypto/aes: rewrite ppc64le asm-cbc routine

This loads the keys once per call, not once per block. This
has the effect of unrolling the inner loop too. This allows
decryption to scale better with available hardware.

Noteably, encryption serializes crypto ops, thus no
performance improvement is seen, but neither is it reduced.

Care is also taken to explicitly clear keys from registers
as was done implicitly in the prior version.

Also, fix a couple of typos from copying the asm used to
load ESPERM.

Performance delta on POWER9:

name             old time/op    new time/op    delta
AESCBCEncrypt1K    1.10µs ± 0%    1.10µs ± 0%   +0.55%
AESCBCDecrypt1K     793ns ± 0%     415ns ± 0%  -47.70%

Change-Id: I52ca939fefa1d776a390a0869e7f4564058942b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/441816
Run-TryBot: Paul Murphy <murp@ibm.com>
Reviewed-by: Joedian Reid <joedian@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
src/crypto/aes/asm_ppc64x.s