Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto/aes: add dedicated asm version of AES, AES-GCM for ppc64 #18499

Closed
matt2909 opened this issue Jan 3, 2017 · 5 comments
Closed

crypto/aes: add dedicated asm version of AES, AES-GCM for ppc64 #18499

matt2909 opened this issue Jan 3, 2017 · 5 comments

Comments

@matt2909
Copy link
Contributor

matt2909 commented Jan 3, 2017

Add a dedicated asm version of AES, AES-GCM for ppc64 - utilizing AES instructions (introduced in Power ISA 2.07) when available.

It should be noted that an asm accelerated version of this algorithm, utilizing AES-NI when available, exists for amd64.

@matt2909 matt2909 changed the title crypto/aes: add dedicated asm version of AES/AES-GCM for ppc64 crypto/aes: add dedicated asm version of AES, AES-GCM for ppc64 Jan 3, 2017
@mundaym
Copy link
Member

mundaym commented Jan 3, 2017

#18076 (AES for ppc64le) is related.

@bradfitz bradfitz added this to the Unplanned milestone Jan 3, 2017
danielboros pushed a commit to danielboros/go that referenced this issue Jul 16, 2019
This patch makes use of ppc64 VMX instructions to accelerate AES
computation. There is a speed boost of over 5 times using these
instructions.

			old ns/op	new ns/op	delta
BenchmarkEncrypt-96	167		33.4		-80%
BenchmarkDecrypt-96	173		32.7		-81.1%
BenchmarkExpand-96	962		140		-85.45

			old MB/s	new MB/s	speedup
BenchmarkEncrypt-96	95.62		479.49		5.01x
BenchmarkDecrypt-96	92.61		489.98		5.29x

Fixes golang#18499
danielboros pushed a commit to danielboros/go that referenced this issue Jul 16, 2019
This patch makes use of ppc64 VMX instructions to accelerate AES
computation. There is a speed boost of over 5 times using these
instructions.

			old ns/op	new ns/op	delta
BenchmarkEncrypt-96	167		33.4		-80%
BenchmarkDecrypt-96	173		32.7		-81.1%
BenchmarkExpand-96	962		140		-85.45

			old MB/s	new MB/s	speedup
BenchmarkEncrypt-96	95.62		479.49		5.01x
BenchmarkDecrypt-96	92.61		489.98		5.29x

Updates golang#18499
@gopherbot
Copy link

Change https://go.dev/cl/404395 mentions this issue: crypto/aes: enable asm block ciphers for ppc64

gopherbot pushed a commit that referenced this issue May 7, 2022
This does not enable GCM or CBC variants for ppc64, they
require more work to support bi-endian.

Updates #18499

Change-Id: Ic2bbe81c60107abc0a4803d8b9a833213286b1d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/404395
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Paul Murphy <murp@ibm.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Filippo Valsorda <valsorda@google.com>
@gopherbot
Copy link

Change https://go.dev/cl/404795 mentions this issue: crypto/aes: add BE support to gcm

@gopherbot
Copy link

Change https://go.dev/cl/405134 mentions this issue: crypto/aes: enable aes-cbc asm for ppc64

gopherbot pushed a commit that referenced this issue May 10, 2022
This adds the code to allow the gcm assembler code to work on
big endian ppc64.

Updates #18499

Change-Id: Iab1ffc9b8af38a0605a91f2621dd9f4a9397b945
Reviewed-on: https://go-review.googlesource.com/c/go/+/404795
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Paul Murphy <murp@ibm.com>
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopherbot pushed a commit that referenced this issue May 13, 2022
This reworks how we load/store vector registers using the new
bi-endian P9 instruction emulation macros. This also removes
quite a bit of asm used to align and reorder vector registers.

This is also a slight improvement on P9 ppc64le/linux:

    name             old speed      new speed      delta
    AESCBCEncrypt1K   936MB/s ± 0%   943MB/s ± 0%  +0.80%
    AESCBCDecrypt1K  1.28GB/s ± 0%  1.37GB/s ± 0%  +6.76%

Updates #18499

Change-Id: Ic5ff71d217d7302b6ae4e8d877c25004bfda5ecd
Reviewed-on: https://go-review.googlesource.com/c/go/+/405134
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
@pmur
Copy link
Contributor

pmur commented May 13, 2022

We have added BE support to all PPC64 AES asm routines for the upcoming 1.19 release. I think this is complete now.

@pmur pmur closed this as completed May 13, 2022
@golang golang locked and limited conversation to collaborators May 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants