opencryptoki / openssl-ibmca

OpenSSL engine and provider for libica.
Apache License 2.0
6 stars 15 forks source link

engine: EC: Cache ICA key in EC_KEY object #89

Closed ifranzki closed 1 year ago

ifranzki commented 1 year ago

Creating a new ICA EC key via ica_ec_key_init() is time consuming, because libica performs EC key checks on the key components.

Currently every sign, verify or derive operation creates a new ICA key, and thus suffers from the long taking EC key checks with every operation.

Change this to create an ICA key on the first usage of an EC key, and attach the ICA key to the EC_KEY object as ex-data. That way, subsequent operations using the same key will reuse the attached ICA key and do not have to create a new ICA key again.