You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Until #111, every key type had 1-n mapping to one or more mechanisms, which could encapsulate all operations on the given key type.
The #111 introduced EC_MONTGOMERY keys, that share the ECDH mechanism with the standard EC(DSA) key objects. The ECDH Operation would be more readable, if we could convert the key object to pkey and ask the object itself for the output length, instead of calling the key specific functions from different modules.
Instead of hardcoding this here I think we should dynamically check at run time (by looking at the mechanisms available perhaps during registration) whether montgomery curves are available.
These functions should probably be exported by the relative mechanism and the mechanism should be sourced via the key type.
We may need to add a new trait to key objects that can be used to extract this info in a more abstract way.
Ie key.get_key_len() or key.get_field_len() or key.get_modulo_len() or some such.
The trait can return Err(CKR_KEY_TYPE_INCONSISTENT)? in the default implementation and only keys that can return a reasonable value will implement this.
If you think it is too much for this PR pleae file an issue and we can make a follow-up later.
Until #111, every key type had 1-n mapping to one or more mechanisms, which could encapsulate all operations on the given key type.
The #111 introduced EC_MONTGOMERY keys, that share the ECDH mechanism with the standard EC(DSA) key objects. The ECDH Operation would be more readable, if we could convert the key object to pkey and ask the object itself for the output length, instead of calling the key specific functions from different modules.
These functions should probably be exported by the relative mechanism and the mechanism should be sourced via the key type.
We may need to add a new trait to key objects that can be used to extract this info in a more abstract way.
Ie key.get_key_len() or key.get_field_len() or key.get_modulo_len() or some such.
The trait can return Err(CKR_KEY_TYPE_INCONSISTENT)? in the default implementation and only keys that can return a reasonable value will implement this.
If you think it is too much for this PR pleae file an issue and we can make a follow-up later.
Originally posted by @simo5 in #111 (comment)
The text was updated successfully, but these errors were encountered: