-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Fix openssl speed for aes-ccm #4480
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
Conversation
apps/speed.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ARIA cipher also supports CCM mode. This scheme could be extended like this:
#ifndef OPENSSL_NO_ARIA
case NID_aria_128_ccm:
case NID_aria_192_ccm:
case NID_aria_256_ccm:
#endif
However, I'd greatly prefer to see a more generic way to determine this (using EVP_CIPHER_mode
perhaps) that doesn't require a list of possible ciphers to be maintained.
switch (EVP_CIPHER_mode(evp_cipher)) {
case EVP_CIPH_CCM_MODE:
loopfunc = EVP_Update_loop_ccm;
break;
default:
loopfunc = EVP_Update_loop;
}
It also looks like the documentation in doc/man3/EVP_EncryptInit.pod
could use a refresh to mention CTR, GCM, CCM, OCB, WRAP and XTS modes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed. implemented the EVP_CIPHER_mode-based solution.
addressed the doc issue in a separate PR: #4498
CCM does not support streaming: An additional call to (EVP_...)Update must precede each call to Update to pass the total message length. The generic Update_loop calls Update one time such that in case of CCM only the total message length is passed. No encryption/decryption measured. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Merged. |
CCM does not support streaming: An additional call to (EVP_...)Update must precede each call to Update to pass the total message length. The generic Update_loop calls Update one time such that in case of CCM only the total message length is passed. No encryption/decryption measured. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from #4480)
CCM does not support streaming: An additional call to (EVP_...)Update must
precede each call to Update to pass the total message length. The generic
Update_loop calls Update one time such that in case of CCM only the total
message length is passed. No encryption/decryption measured.
... Therefore, 'openssl speed -evp aes-xxx-ccm' shows 'infinite' numbers.
I use this patch for some time to measure actual aes-ccm performance. Im not completely happy with it because the aes-ccm results are not 100% comparable with the other ciphers. However, its more useful than the present 'infinite' results. Opinions ?