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

CryptoAlg-682: Improve AES-GCM on ARMv8 #112

Merged
merged 6 commits into from
Apr 23, 2021
Merged

Conversation

nebeid
Copy link
Contributor

@nebeid nebeid commented Mar 17, 2021

Issues:

Resolves CryptoAlg-682

Description of changes:

AWS-LC lags OpenSSL by 14-18% in the performance of AES-GCM-128/256 on Armv8, while it exceeds it on x86_64.
This PR merges in the changes in OpenSSL's ghashv8-armx.pl as in OpenSSL 1.1.1k.
These changes extend Gueron's method from 2x-aggregate factor to 4x-aggregate (see slide 22 in Gueron's slides) and matches the implementation in ghash-x86_64.pl

Call-outs:

N/A

Testing:

Speed tests were run on ARMv8, 2.5GHz:

Before:
Did 204000 AES-128-GCM (8192 bytes) seal operations in 1004479us (203090.4 ops/sec): 1663.7 MB/s
Did 103000 AES-128-GCM (16384 bytes) seal operations in 1002904us (102701.8 ops/sec): 1682.7 MB/s
Did 173000 AES-256-GCM (8192 bytes) seal operations in 1000072us (172987.5 ops/sec): 1417.1 MB/s
Did 88000 AES-256-GCM (16384 bytes) seal operations in 1008040us (87298.1 ops/sec): 1430.3 MB/s

After:
Did 252000 AES-128-GCM (8192 bytes) seal operations in 1001478us (251628.1 ops/sec): 2061.3 MB/s
Did 128000 AES-128-GCM (16384 bytes) seal operations in 1003033us (127612.9 ops/sec): 2090.8 MB/s
Did 208000 AES-256-GCM (8192 bytes) seal operations in 1004083us (207154.2 ops/sec): 1697.0 MB/s
Did 105000 AES-256-GCM (16384 bytes) seal operations in 1002262us (104763.0 ops/sec): 1716.4 MB/s

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

$code.=<<___;
@ calculate H^3 and H^4
vpmull.p64 $Xl,$H, $H2
vpmull.p64 $Yl,$H2,$H2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fix the indentation throughout the file please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@nebeid nebeid force-pushed the CA682-aes-gcm branch 3 times, most recently from dc1142d to 8c2191f Compare April 12, 2021 13:53
dkostic
dkostic previously approved these changes Apr 13, 2021
and generated filed under `generated-src`
@nebeid nebeid requested a review from dkostic April 21, 2021 17:21
@nebeid nebeid merged commit 6642666 into aws:main Apr 23, 2021
WillChilds-Klein pushed a commit to WillChilds-Klein/aws-lc that referenced this pull request Mar 9, 2022
aqjune-aws pushed a commit to aqjune-aws/aws-lc-public that referenced this pull request Mar 6, 2024
Update curve25519_x25519{_byte} to make AWS-LC's delocator work
s2n-bignum original commit: awslabs/s2n-bignum@88324d8
dkostic pushed a commit to dkostic/aws-lc that referenced this pull request Jul 22, 2024
Update curve25519_x25519{_byte} to make AWS-LC's delocator work
s2n-bignum original commit: awslabs/s2n-bignum@88324d8
torben-hansen pushed a commit to torben-hansen/aws-lc that referenced this pull request Sep 18, 2024
Update curve25519_x25519{_byte} to make AWS-LC's delocator work
s2n-bignum original commit: awslabs/s2n-bignum@88324d8
torben-hansen pushed a commit to torben-hansen/aws-lc that referenced this pull request Sep 18, 2024
Update curve25519_x25519{_byte} to make AWS-LC's delocator work
s2n-bignum original commit: awslabs/s2n-bignum@88324d8

s2n-bignum original commit: awslabs/s2n-bignum@b134a7e
torben-hansen pushed a commit to torben-hansen/aws-lc that referenced this pull request Sep 19, 2024
Update curve25519_x25519{_byte} to make AWS-LC's delocator work
s2n-bignum original commit: awslabs/s2n-bignum@88324d8
dkostic pushed a commit to dkostic/aws-lc that referenced this pull request Dec 5, 2024
Update curve25519_x25519{_byte} to make AWS-LC's delocator work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants