Privatize functions and some types in hash headers #265

Merged
felixc-arm merged 1 commit from privatize-hash-functions into development 2025-05-12 15:32:25 -05:00
felixc-arm commented 2025-04-23 05:35:36 -05:00 (Migrated from github.com)

Privatizes all functions in the following files by guarding them with MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS

md5.h
ripemd160.h
sha1.h
sha256.h
sha3.h
sha512.h

Also privatizes the type mbedtls_sha3_id in sha3.h - All of the context types in these files are found in mbedtls_psa_hash_operation_t in the file tf-psa-crypto/include/psa/crypto_builtin_primitives.h and so are kept unprivatized/internal.
Otherwise there are no other types/macros in these files.

Resolves https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/224

PR checklist

  • changelog not required because: will come later encompassing all privatization using MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS
  • framework PR not required
  • mbedtls development PR not required because: crypto change only
  • mbedtls 3.6 PR not required because: 4.0/1.0 only change
  • tests not required because: no functional change
Privatizes all functions in the following files by guarding them with `MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS` `md5.h` `ripemd160.h` `sha1.h` `sha256.h` `sha3.h` `sha512.h` Also privatizes the type `mbedtls_sha3_id` in `sha3.h` - All of the context types in these files are found in `mbedtls_psa_hash_operation_t` in the file `tf-psa-crypto/include/psa/crypto_builtin_primitives.h` and so are kept unprivatized/internal. Otherwise there are no other types/macros in these files. Resolves https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/224 ## PR checklist - [ ] **changelog** not required because: will come later encompassing all privatization using `MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS` - [ ] **framework PR** not required - [ ] **mbedtls development PR** not required because: crypto change only - [ ] **mbedtls 3.6 PR** not required because: 4.0/1.0 only change - **tests** not required because: no functional change
bjwtaylor (Migrated from github.com) reviewed 2025-05-08 09:43:08 -05:00
bjwtaylor (Migrated from github.com) commented 2025-05-08 09:43:08 -05:00

Minor point and not critical: I'm assuming that the middle section here can't be privatised, in which case it may be worth moving the enum def down as it doesn't appear to be needed in the struct. Then you can scrap the second if defined.

Minor point and not critical: I'm assuming that the middle section here can't be privatised, in which case it may be worth moving the enum def down as it doesn't appear to be needed in the struct. Then you can scrap the second if defined.
bjwtaylor (Migrated from github.com) approved these changes 2025-05-08 09:44:15 -05:00
felixc-arm (Migrated from github.com) reviewed 2025-05-09 04:16:55 -05:00
felixc-arm (Migrated from github.com) commented 2025-05-09 04:16:55 -05:00

Yeah, I was working with the 'keep everything in place and just add the guards to minimize changes' thought, but I'll do the change here if I need to update this patch for another reason.

Yeah, I was working with the 'keep everything in place and just add the guards to minimize changes' thought, but I'll do the change here if I need to update this patch for another reason.
valeriosetti (Migrated from github.com) approved these changes 2025-05-09 08:12:13 -05:00
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-Mbed-TLS/TF-PSA-Crypto!265
No description provided.