Privatize functions and some types/macros in cipher mode headers #275

Merged
felixc-arm merged 4 commits from privatize-cipher-mode-functions into development 2025-05-12 11:09:12 -05:00
felixc-arm commented 2025-04-30 08:34:35 -05:00 (Migrated from github.com)

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

ccm.h
cmac.h
gcm.h

n.b. block_cipher.h is specified in the issue, but does not have any types/macros that can be privatized (and does not contain any functions at all).

Also privatizes the following macros, including unlinking them from the Doxygen to avoid CI errors where applicable:
MBEDTLS_CCM_<EN/DE>CRYPT
MBEDTLS_CCM_STAR_<EN/DE>CRYPT
MBEDTLS_AES_BLOCK_SIZE
MBEDTLS_DES3_BLOCK_SIZE
MBEDTLS_CMAC_MAX_BLOCK_SIZE
MBEDTLS_GCM_<EN/DE>CRYPT

Privatizes the types:
mbedts_cmac_context_t

Does not privatize the types/macros:
mbedtls_ccm_context
MBEDTLS_CIPHER_BLKSIZE_MAX (deprecated anyway)
MBEDTLS_GCM_HTABLE_SIZE
mbedtls_gcm_context

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

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 change only
  • tests not required because: no functional change
Privatizes all functions in the following files by guarding them with `MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS` `ccm.h` `cmac.h` `gcm.h` n.b. `block_cipher.h` is specified in the issue, but does not have any types/macros that can be privatized (and does not contain any functions at all). Also privatizes the following macros, including unlinking them from the Doxygen to avoid CI errors where applicable: `MBEDTLS_CCM_<EN/DE>CRYPT` `MBEDTLS_CCM_STAR_<EN/DE>CRYPT` `MBEDTLS_AES_BLOCK_SIZE` `MBEDTLS_DES3_BLOCK_SIZE` `MBEDTLS_CMAC_MAX_BLOCK_SIZE` `MBEDTLS_GCM_<EN/DE>CRYPT` Privatizes the types: `mbedts_cmac_context_t` Does _not_ privatize the types/macros: `mbedtls_ccm_context` `MBEDTLS_CIPHER_BLKSIZE_MAX` (deprecated anyway) `MBEDTLS_GCM_HTABLE_SIZE` `mbedtls_gcm_context` Resolves https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/226 ## 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 change only - **tests** not required because: no functional change
bjwtaylor (Migrated from github.com) reviewed 2025-05-06 07:10:40 -05:00
@ -44,10 +44,12 @@
#include "mbedtls/block_cipher.h"
bjwtaylor (Migrated from github.com) commented 2025-05-06 07:10:40 -05:00

Can we add the /* MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS */ comment onto here?

Can we add the /* MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS */ comment onto here?
bjwtaylor (Migrated from github.com) reviewed 2025-05-06 07:11:29 -05:00
@ -30,8 +30,10 @@
bjwtaylor (Migrated from github.com) commented 2025-05-06 07:11:16 -05:00

Can we add the /* MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS */ comment onto here?

Can we add the /* MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS */ comment onto here?
bjwtaylor (Migrated from github.com) approved these changes 2025-05-09 07:12:39 -05:00
valeriosetti (Migrated from github.com) approved these changes 2025-05-09 08:10:14 -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!275
No description provided.