-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize AES/GCM cipher and IV init and improve array cleanup code
The cipher initialization cost has been found to be computationally expensive, especially in the OpenSSL 3.x API. In order to optimize the cost of using OpenSSL to perform consecutive AES/GCM encryption and decryption operations, two flags are set and passed as parameters. The first flag indicates whether a different cipher is required for the upcoming operations (i.e., the key size has changed). If that is the case, a cipher is initialized and set to the provided context. If not, those steps are omitted, thus reducing the time required for the operation. The second flag indicates whether the IV length has changed and is used in a similar way as the first flag. The rest of the steps required for the operation are performed regardless of the flags. The handling of freeing arrays that were part of that functionality is, also, updated to comply with the newer approach to cleanup code. Signed-off by: Kostas Tsiounis <kostas.tsiounis@ibm.com>
- Loading branch information
1 parent
27c0f0f
commit 20affef
Showing
3 changed files
with
265 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.