-
Notifications
You must be signed in to change notification settings - Fork 2.1k
sys/psa_crypto: Rework Headers #21512
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
Conversation
5530329
to
edac353
Compare
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.
Thanks for your work on this! I still have some questions below.
We've also got a merge conflict with #21455 merged in tonight. |
5026111
to
71f1a8e
Compare
I just rebased this series onto the latest master branch and resolved any merge conflicts. |
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.
Thanks again for your work on this! LGTM now.
Please shorten the three failing commits messages to less than 72 characters and force-push. Let's get this finally done!
Would it be fine if i squash all/some commits together? |
Sure, whatever you see fit :) |
Currently PSA backends cannot use other backends because the necessary definitions are defined in a single big header file. This prevents us from creating a generic HMAC backend based on the available hash backends, as the hash context struct is not available when defining the HMAC context struct. Fix this by spliting the headers into separate files. This makes it possible us use the hash context definitions without pulling in the remaining context definitions. Signed-off-by: Armin Wolf <W_Armin@gmx.de>
71f1a8e
to
501811e
Compare
Are there any remaining issues? |
No, this is ready to be merged! Thanks again for your work on this! |
Nice, thank you. |
There we go, finally merged! 🎉 I hope this can unlock the work on the generic HMAC implementation in #20758 :) |
I am already working on it. |
Contribution description
Currently the headers of the PSA crypto API are designed in a monolithic fashion: all types are defined in a single file, all
context structs are defined inside a single file, etc.
This however makes it impossible to build stacked PSA crypto backends. For example build a generic HMAC backend based upon the already existing hash backend is currently not possible do to incomplete type definitions when trying to define the necessary context struct.
This PR breaks up the monolithic headers into smaller ones that can be used by stacked backends without pulling in the other (possibly incomplete) type definitions. In the future this will make it possible to finally build a generic HMAC backend for the PSA crypto API.
Please note that this PR is still a draft since i was unable to test it on a board with a secure element. I was hoping that the CI service will do that.
Testing procedure
Since the PR only reorders header definitions no functional impacts are expected. However in order to avoid build failures i ran all PSA crypto tests inside the
test/sys
directory.Issues/PRs references
This PR is a prerequisite for PR #20758.