Skip to content

Conversation

p-steuer
Copy link
Member

@p-steuer p-steuer commented Oct 7, 2017

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 ?

@richsalz richsalz added branch: master Merge to master branch approval: review pending This pull request needs review by a committer labels Oct 7, 2017
apps/speed.c Outdated
Copy link
Contributor

@paulidale paulidale Oct 8, 2017

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

Copy link
Member Author

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>
Copy link
Contributor

@paulidale paulidale left a comment

Choose a reason for hiding this comment

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

Thanks.

@paulidale paulidale added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Oct 9, 2017
@paulidale
Copy link
Contributor

Merged.

@paulidale paulidale closed this Oct 9, 2017
levitte pushed a commit that referenced this pull request Oct 9, 2017
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)
@p-steuer p-steuer deleted the fixes branch October 15, 2017 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: done This pull request has the required number of approvals branch: master Merge to master branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants