-
Notifications
You must be signed in to change notification settings - Fork 28
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
Support for interruptible key agreement/exchange #198
Comments
Following the patterns in #107, the obvious pattern for these interruptible operations would be something like the following:
One concern I have is that these names are getting rather long (and Key QuestionDo we need to devise a shorter format for naming these type of operations and their functions, so that code remains both readable and unambiguous? And if we do, we should retro-fit the same pattern to #23 & #107. I'll propose a strawman idea, to provoke a reaction... how about using Note that to achieve disambiguation in 31 characters for public key export, we need a suffix that is 7 characters or less as |
Perhaps, given that these functions will not require multi-part operations, we could elide the 'interruptible' entirely in the identifier names? - the use of the interruptible form of the API would still be evident in the code from the use of
|
Maybe |
See the discussion of API naming options in #98, which concluded with the following proposal for key generation and key agreement:
The extension to this pattern for public key export would be:
|
In light of #194, should the interruptible key generation support additional production parameters, or only the default production parameters? |
Similarly, in light of #149, should an interruptible public key export operation support alternative output formats? |
We should have a way to have both custom production parameters and interruptibility. We aren't actually going to implement those variants in Mbed TLS since we only do custom production parameters for RSA and we only do interruptibility for ECC. But if someone needs them, they should exist in the API design so that implementers and users agree on naming, order of parameters, etc. |
The current opinion is that the default API should just cater for the default use cases (standard key generation/key format), and we can add additional setup or completion functions for interruptible operations that do need extended behavior. This also avoids trying to pre-empt a decision on API naming for things such as formatted key export. |
Issue #23 considers interruptible API design, and specifically looks at an API for asymmetric signature. There is a PR for an interruptible API for asymmetric signature creation and verification in #107.
Another use case that requires an interruptible operation is key agreement, in particular ECDH. (See Mbed-TLS/mbedtls#9044)
For ECDH, the complex computation occurs at the following points:
In the current PSA Crypto API, steps (2) and (3) occur as part of the key agreement function. Step (1) might occur during key generation, or during public key export, depending on the implementation's approach to storing ECC keys.
For full coverage of the key agreement use case we would need interruptible operations for all three APIs (key generation, key export, and key agreement).
As each of these functions have simple (bounded) inputs, the interruptible operations can be much simpler that the one designed for asymmetric signature. In particular, each operation only requires a single setup function taking all the inputs (called once) and a single completion function providing the outputs (called until finished).
The text was updated successfully, but these errors were encountered: