-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Use AWS-LC AES-GCM implementation #5492
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
Use AWS-LC AES-GCM implementation #5492
Conversation
55c91d7 to
b1a1e7b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5492 +/- ##
==========================================
- Coverage 82.84% 82.83% -0.01%
==========================================
Files 269 269
Lines 27737 27723 -14
==========================================
- Hits 22978 22965 -13
+ Misses 4759 4758 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Looking at how much binary size we shaved by removing 16 dependencies, I found out AWS-LC AVX512 implementation is actually adding 600k of binary size (+25%): |
|
I've pushed a change to disable AVX512, let's see how it goes: https://buildkite.com/firecracker/mancio-test-perf/builds/76 The size is now just 8k more: |
1f00b3b to
f8c2e2d
Compare
Adds a perf test that generates and uses a MMDSv2 token 100 times in a loop. Signed-off-by: Riccardo Mancini <[email protected]>
The previous dependency is outdated and uses deprecated APIs. With this change we start using AWS-LC, with no changes visible to our users. This also gets rid of a bunch of dependencies. Signed-off-by: Riccardo Mancini <[email protected]>
After replacing aws-gcm with aws-lc AES-GCM implementation, we noticed the binary size increased by 600k. This is mostly due to the AVX512 functions taking a ridiculous amount of space. 0000000002662240 0000000000339921 t aws_lc_0_32_3_aes_gcm_decrypt_avx512 0000000002322304 0000000000339925 t aws_lc_0_32_3_aes_gcm_encrypt_avx512 This commit disables AVX512 support in AWS-LC as we didn't measure any performance penalty. Signed-off-by: Riccardo Mancini <[email protected]>
b04f9bf to
1bc19e7
Compare
Changes
Replace the
aes-gcmcrate with the AES-GCM implementation insideaws-lc-rs.Also, adds a performance test to verify there is no significant regression. From my testing, some instance/kernel combinations are faster and some are slower. The biggest regression is 30us (7%) on m6a.
A/B passed on this new test: https://buildkite.com/firecracker/mancio-test-perf/builds/77
I also disabled AVX512 compilation as it was increasing binary size by 600kb with no clear performance gain.
Reason
Remove dependency on
aes-gcmpackage which is using deprecated functions from[email protected]. The package hasn't received a stable update in 2 years.This gets rid of 16 dependencies (from 219 to 203) and unblocks dependabot PRs.
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.PR Checklist
tools/devtool checkbuild --allto verify that the PR passesbuild checks on all supported architectures.
tools/devtool checkstyleto verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md.Runbook for Firecracker API changes.
integration tests.
TODO.rust-vmm.