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

proposal: internal/cpu, crypto/aes: support VAES and VPCLMULQDQ instructions in AES-GCM cipher functions #42726

Open
tpaint opened this issue Nov 19, 2020 · 3 comments

Comments

@tpaint
Copy link

@tpaint tpaint commented Nov 19, 2020

What version of Go are you using (go version)?

$ go version 1.15.5 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)? amd64 linux

go env Output
$ go env
amd64 linux

What did you do?

This is a request/proposal for two new features:

  1. In internal/cpu: detect CPU support for AVX-512 VAES and VPCLMULQDQ SIMD instructions
  2. In crypto/aes: performance-optimize the AES-GCM cipher functions using VAES and VPCLMULQDQ instructions

What did you expect to see?

in src/crypto/aes/gcm_amd64.s, the request is to support new AVX-512 SIMD crypto instructions VAES and VPCLMULQDQ.

What did you see instead?

in src/crypto/aes/gcm_amd64.s currently there is existing support only for the scalar AES and PCLMULQDQ instructions

We have developed proposed patches for go v1.15.5 as follows:

  1. internal/cpu: check the cpu registers for presence of VAES and VPCLMULQDQ, set flags accordingly
  2. crypto/aes: performance-optimize AES-GCM using these instructions

The patches will be contributed and submitted to the Go Gerrit for review.

References:

  1. https://www.tomshardware.com/news/intel-10nm-xeon-ice-lake-sp-sunny-cove-core-architecture
  2. https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
@gopherbot
Copy link

@gopherbot gopherbot commented Nov 19, 2020

Change https://golang.org/cl/271521 mentions this issue: internal/cpu: Add detection for VAES and VPCLMULQDQ instructions

@dmitshur dmitshur changed the title Support VAES and VPCLMULQDQ instructions in cryto/cipher/AES-GCM and internal/cpu internal/cpu, crypto/aes: support VAES and VPCLMULQDQ instructions in AES-GCM cipher functions Nov 30, 2020
@dmitshur dmitshur added this to the Backlog milestone Nov 30, 2020
@FiloSottile
Copy link
Member

@FiloSottile FiloSottile commented Nov 30, 2020

Please keep in mind the new assembly policy. Happy to work with you to make sure the contribution follows that policy.

@katiehockman katiehockman changed the title internal/cpu, crypto/aes: support VAES and VPCLMULQDQ instructions in AES-GCM cipher functions proposal: internal/cpu, crypto/aes: support VAES and VPCLMULQDQ instructions in AES-GCM cipher functions Nov 30, 2020
@gopherbot gopherbot added the Proposal label Nov 30, 2020
@ianlancetaylor ianlancetaylor added this to Incoming in Proposals Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Proposals
Incoming
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants