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

Add AES CBC cipher to speed.cc #2315

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

Conversation

andrewhop
Copy link
Contributor

Description of changes:

  1. Add CBC mode by itself to the speed tool
  2. Update SpeedEvpGenericChunk to handle CBC which adds more padding

Testing:

Tested locally, will also be covered in CI:

bssl speed -filter CBC -chunks 128
Did 7850000 EVP-AES-128-CBC encrypt init operations in 1000096us (7849246.5 ops/sec)
Did 5617000 EVP-AES-128-CBC encrypt (128 bytes) operations in 1000042us (5616764.1 ops/sec): 718.9 MB/s
Did 7293000 EVP-AES-128-CBC decrypt init operations in 1000015us (7292890.6 ops/sec)
Did 8290000 EVP-AES-128-CBC decrypt (128 bytes) operations in 1000005us (8289958.6 ops/sec): 1061.1 MB/s

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.

@andrewhop andrewhop requested a review from a team as a code owner April 7, 2025 21:45
@@ -2875,6 +2877,9 @@ bool Speed(const std::vector<std::string> &args) {
!SpeedEvpCipherGeneric(EVP_aes_128_ctr(), "EVP-AES-128-CTR", kTLSADLen, selected) ||
!SpeedEvpCipherGeneric(EVP_aes_192_ctr(), "EVP-AES-192-CTR", kTLSADLen, selected) ||
!SpeedEvpCipherGeneric(EVP_aes_256_ctr(), "EVP-AES-256-CTR", kTLSADLen, selected) ||
!SpeedEvpCipherGeneric(EVP_aes_128_cbc(), "EVP-AES-128-CBC", kTLSADLen, selected) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

what padding is used here? ISO10126 or PKCSv1.5?

Not a concern for this change, but ACCP supports ISO10126 for CBC, and if we could offload that padding to an AWS-LC API, it'd be a nice simplification.

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.

2 participants