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

aes_gcm/x86_64: Tweak gcm_ghash_vpclmulqdq_avx2_1. #2478

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

briansmith
Copy link
Owner

@briansmith briansmith commented Mar 12, 2025

Instead of starting with the body of the original gcm_ghash_vpclmulqdq_avx2 and removing the multi-block support, start with gcm_gmult_vpclmulqdq_avx2 and add the XOR of aad.

The instruction scheduling seems a bit better. Also, this computes bswap(Xi ^ aad) instead of bswap(Xi) ^ bswap(aad), saving one pshufb.

@briansmith briansmith self-assigned this Mar 12, 2025
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.60%. Comparing base (2723abb) to head (c41cfcb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2478      +/-   ##
==========================================
- Coverage   96.61%   96.60%   -0.01%     
==========================================
  Files         180      180              
  Lines       21814    21814              
  Branches      539      539              
==========================================
- Hits        21076    21074       -2     
  Misses        623      623              
- Partials      115      117       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Instead of starting with the body of the original
`gcm_ghash_vpclmulqdq_avx2` and removing the multi-block support, start with
`gcm_gmult_vpclmulqdq_avx2` and add the XOR of `aad`.

The instruction scheduling seems a bit better. Also, this computes
`bswap(Xi ^ aad)` instead of `bswap(Xi) ^ bswap(aad)`, saving one pshufb.
@briansmith briansmith force-pushed the b/aes-gcm-avx2-tweak-2 branch from cd9adfe to c41cfcb Compare March 12, 2025 19:34
@briansmith briansmith added this to the 0.17.15 milestone Mar 12, 2025
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.

1 participant