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

P-384/521 runtime check for s2n-bignum on aarch64 #983

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

dkostic
Copy link
Contributor

@dkostic dkostic commented Apr 26, 2023

Decide in runtime which s2n-bignum functions to call for P-384/521 field arithmetic. This gives us small improvement in the performance of P-384/521 operations on Graviton 3 (and any other non-Apple aarch64 processor). Performance (ops/s) measured on GV 3 c7g.4xlarge instance:

Operation           |  Before  |  After  | Speedup  |
----------------------------------------------------
P-384 ECDH          |   2975   |  3329   |  x1.12   |
P-384 ECDSA sign    |   8345   |  8871   |  x1.06   |
P-384 ECDSA verify  |   3306   |  3659   |  x1.11   |
P-521 ECDH          |   1603   |  2141   |  x1.33   |
P-521 ECDSA sign    |   3819   |  4466   |  x1.17   |
P-521 ECDSA verify  |   1599   |  2025   |  x1.27   |

While I'm here, replace calls to OPENSSL_ia32cap_get() with corresponding CRYPTO_is_ABC_capable() for x86.

Issues:

Resolves #ISSUE-NUMBER1
Addresses #ISSUE-NUMBER2

Description of changes:

Describe AWS-LC’s current behavior and how your code changes that behavior. If there are no issues this pr is resolving,
explain why this change is necessary.

Call-outs:

Point out areas that need special attention or support during the review process. Discuss architecture or design changes.

Testing:

How is this change tested (unit tests, fuzz tests, etc.)? Are there any testing steps to be verified by the reviewer?

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

Decide in runtime which s2n-bignum functions to call for P-384/521
field arithmetic. This gives us small improvement in the performance
of P-384/521 operations on Graviton 3 (and any other non-Apple aarch64
processor). Performance (ops/s) measured on GV 3 c7g.4xlarge instance:

Operation           |  Before  |  After  | Speedup  |
----------------------------------------------------
P-384 ECDH          |   2975   |  3329   |  x1.12   |
P-384 ECDSA sign    |   8345   |  8871   |  x1.06   |
P-384 ECDSA verify  |   3306   |  3659   |  x1.11   |
P-521 ECDH          |   1603   |  2141   |  x1.33   |
P-521 ECDSA sign    |   3819   |  4466   |  x1.17   |
P-521 ECDSA verify  |   1599   |  2025   |  x1.27   |

While I'm here, replace calls to `OPENSSL_ia32cap_get()` with
corresponding `CRYPTO_is_ABC_capable()` for x86.
@dkostic dkostic enabled auto-merge (squash) April 26, 2023 17:03
Copy link
Contributor

@torben-hansen torben-hansen left a comment

Choose a reason for hiding this comment

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

nice

@dkostic dkostic merged commit ae87faf into aws:main Apr 26, 2023
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