Rename PSA internal identifiers #241

Open
opened 2019-09-03 05:14:13 -05:00 by gilles-peskine-arm · 2 comments
gilles-peskine-arm commented 2019-09-03 05:14:13 -05:00 (Migrated from github.com)

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
### 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
ciarmcom commented 2019-09-03 10:51:17 -05:00 (Migrated from github.com)

Internal Jira reference: https://jira.arm.com/browse/IOTCRYPT-882

*Internal Jira reference: https://jira.arm.com/browse/IOTCRYPT-882*
adbridge commented 2019-11-04 06:40:31 -06:00 (Migrated from github.com)

Apologies, this was closed in error by the automated bot - re-opening.

Apologies, this was closed in error by the automated bot - re-opening.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-ARMmbed/mbed-crypto#241
No description provided.