]> Cypherpunks repositories - gostls13.git/commit
crypto/aes: simplify key load+store on PPC64
authorPaul E. Murphy <murp@ibm.com>
Thu, 24 Mar 2022 17:18:30 +0000 (12:18 -0500)
committerPaul Murphy <murp@ibm.com>
Fri, 13 May 2022 14:14:49 +0000 (14:14 +0000)
commitd4dd7acd2e9654e9769f4fa131540ad4e991adb5
tree0f42a3d74df7221a042aaf604eff12f8da1f66bd
parentb553f51fcd959c9d2d113ce74eba6eac958e2a5b
crypto/aes: simplify key load+store on PPC64

There is no requirement for how the expanded keys are stored
in memory. They are only accessed by asm routines. If keys
are stored directly with stxvd2x, they can be loaded directly
with lxvd2x.

This speeds up ppc64le key expansion and crypting a bit too.

POWER9 aes benchmark delta:

name     old time/op    new time/op    delta
Encrypt    15.0ns ± 0%    13.0ns ± 0%  -13.17%
Decrypt    14.6ns ± 0%    13.0ns ± 0%  -11.02%
Expand     49.1ns ± 0%    45.1ns ± 0%   -8.01%

name             old time/op    new time/op    delta
AESCBCEncrypt1K    1.08µs ± 0%    1.08µs ± 0%   -0.46%
AESCBCDecrypt1K     744ns ± 0%     562ns ± 0%  -24.46%

Change-Id: I91f3cdc770a178aee849301e4e6aa5a4a517ad10
Reviewed-on: https://go-review.googlesource.com/c/go/+/405135
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/crypto/aes/asm_ppc64x.s