-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Legacy-PSA bridge design: symmetric #8769
Legacy-PSA bridge design: symmetric #8769
Conversation
Signed-off-by: Gilles Peskine <[email protected]>
Signed-off-by: Gilles Peskine <[email protected]>
Signed-off-by: Gilles Peskine <[email protected]>
Signed-off-by: Gilles Peskine <[email protected]>
Sorry for picking on names, but if it's about symmetric crypto it's hardly about PK, but rather legacy-PSA? |
Er, yeah, too much copy-paste. Too late for the branch name but I've changed the title. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
||
Applications transitioning to the PSA API may wish to take advantage of PSA accelerated ciphers or opaque keys, while still constrained to provide the legacy `cipher.h` interface. | ||
|
||
Mbed TLS 3.5 offers `mbedtls_cipher_setup_psa()` for this transition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes about this function:
- it's marked as deprecated;
- it only works for a limited number of ciphers / mechanisms : only AES with GCM, CCM, CCM*, CBC, ECB;
- it doesn't when AES is driver-only (it should take advantage of a driver when present, tough, probably just won't work unless
AES_C
is also defined because sorting out the dependencies for this was not a priority considering this function is deprecated).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we can reasonably lift these limitations in 3.6.x if there's demand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I don't foresee any problem here. The main reason it wasn't done is it didn't look like a priority.
* We do not seem to need this much in our own code. TLS has its own conversion, limited to the subset of mechanisms that it uses. | ||
* The [“Symmetric encryption” section of the transition guide](../../psa-transition.md#symmetric-encryption) does not demonstrate the need for applications to write complex code to bridge the gap, the way it does with asymmetric crytography in Mbed TLS 3.5. However, there is arguably an omission there, since the transition guide does not show how to translate metadata. | ||
|
||
[OPEN] Do we need conversion functions between encodings of cipher mechanisms? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm weakly inclined to say no. OTOH, those would be rather easy to provide. Also, I'll note we could easily add those in 3.6.x if requested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the open points, we're currently planning no action, so I don't think we need issues. |
e78c975
into
Mbed-TLS:dev/gilles-peskine-arm/pk-psa-bridge-design
Document requirements for bridging legacy APIs and PSA APIs. The scope of this pull request is symmetric crytography (cipher/AEAD, MAC, key derivation, random generation). Together with #8657, it represents all the classes of cryptographic mechanisms that exist in some form in both APIs.
Follow-up to #8657, to be rebased once that is merged.
PR checklist
Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")