Rename PSA internal identifiers
- Dominant language
- C
- Stars
- 108
- Forks
- 95
- PR merge metrics
- No merged PRs in 30d
Description
### Description
There are three categories of identifiers in the PSA part of the Mbed Crypo API.
* Identifiers defined by the official PSA API specification. These use names `psa_xxx` or `PSA_XXX`.
* Implementation-specific extensions that are part of Mbed Crypto. These have inconsistently used names `psa_xxx` or `mbedtls_psa_xxx`. For functions, I used `mbedtls_psa_xxx` for things that I considered to be strictly Mbed Crypto only, and `psa_xxx` for things that I considered experimental features possibly to be added to PSA later. But in retrospect I don't think that distinction should be reflected in the naming. For macros, I stuck to `PSA_XXX` to avoid complaints from `check-names.sh`.
* Internal identifiers that users aren't meant to use, and can see only due to the lack of namespacing in C. These are mostly macros used to build and analyze constants (`PSA_KEY_TYPE_CATEGORY_XXX`, `PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH_CASE`, …). There are also a few types and structures in `crypto_struct.h`.
We should use separate namespaces for these three categories. Only the first category should use the reserved PSA namespace, which is yet to be defined (internal link: https://github.com/ARMmbed/psa-crypto/issues/248).
### Issue request type
[ ] Question
[x] Enhancement
[ ] Bug
Contributor guide
Research direction
Start by reviewing the PSA API specification and the namespace discussion in issue #248, then inspect the internal macros, types, and structures in crypto_struct.h. Check how check-names.sh constrains macro names. Done means the three identifier categories use separate namespaces without exposing implementation-only names through the reserved PSA namespace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100