-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys/psa_crypto: split algorithm definitions #20906
Conversation
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 and CI doesn't complain, but I'd like @Einhornhool to have a look at it before formally approving.
Oh, you'd just have to rename some of your commits to stay shorter than 72 characters. |
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.
Thank you, I really like this! I just have one comment below :)
It's not a MUST, though.
I think you can also just squash them and have only one commit for these |
If you are ok with one big commit, then i wont complain :) |
Just a single question: what should happen if say mac.h need to include hashes.h? Should psa_mac depend on psa_mac? |
Good question, I'd say if its just about the headers, then no, and you could just include hashes.h in mac.h explicitly. But if the implementation also unconditionally needs hashes, then the module dependency makes sense. |
Split definition of psa_algorithm_t into a separate file, together with some basic algorithm macros. Also move the definitions of the hash/mac/cipher/AEAD/etc algorithm macros into separate files as well. This allows PSA crypto backends to use this definitions without pulling in all the other type definitions. Signed-off-by: Armin Wolf <W_Armin@gmx.de>
The PSA crypto API specification 1.1.1 introduced two new algorithms for HKDF. Add support for those. Signed-off-by: Armin Wolf <W_Armin@gmx.de>
A definition of PSA_ALG_HASH_ANY does not exist, use PSA_ALG_ANY_HASH instead. Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Are there any remaining issues? |
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 now, thanks again!
Contribution description
This PR serves as the foundation for the future reorganization of the PSA headers. The final goal is to split all definitions into separate header files, so backends can for example use psa_algorithm_t without pulling in the definition for psa_mac_operation_t.
The first step for this is spliting the definition of psa_algorithm_t into a separate file. The remaining algorithm definitions are also split into separate files to reduce the size of the crypto_values.h file.
This PR also adds a pair of missing HKDF algorithm definitions and fixes an issue inside the definition of PSA_ALG_IS_WILDCARD.
Testing procedure
The changes where tested using the PSA crypto unit tests and appear to work.
Issues/PRs references