Privatize functions and some types/macros in cipher primitive headers #271

Merged
felixc-arm merged 3 commits from privatize-cipher-primitive-functions into development 2025-05-13 13:28:44 -05:00
felixc-arm commented 2025-04-28 09:14:46 -05:00 (Migrated from github.com)

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

aes.h
aria.h
camellia.h
des.h
chacha20.h
chachapoly.h
poly1305.h

Also privatizes all MBEDTLS_<CIPHER>_ENCRYPT & MBEDTLS_<CIPHER>_DECRYPT macros, including unlinking them from the Doxygen to avoid CI errors.

Also privatizes the macros:
MBEDTLS_ARIA_MAX_KEYSIZE
MBEDTLS_DES_KEY_SIZE

Privatizes the types:
mbedtls_aes_xtx_context
mbedtls_aes_implementation
mbedtls_des_context
mbedtls_des3_context

Does not privatize the types/macros:
MBEDTLS_ARIA_BLOCKSIZE
MBEDTLS_ARIA_MAX_ROUNDS
mbedtls_aes_context
mbedls_aria_context
mbedtls_camellia_context
mbedtls_chacha20_context
mbedtls_chachapoly_mode_t
mbedtls_chachapoly_context
mbedtls_poly1305_context

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

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` `aes.h` `aria.h` `camellia.h` `des.h` `chacha20.h` `chachapoly.h` `poly1305.h` Also privatizes all `MBEDTLS_<CIPHER>_ENCRYPT` & `MBEDTLS_<CIPHER>_DECRYPT` macros, including unlinking them from the Doxygen to avoid CI errors. Also privatizes the macros: `MBEDTLS_ARIA_MAX_KEYSIZE` `MBEDTLS_DES_KEY_SIZE` Privatizes the types: `mbedtls_aes_xtx_context` `mbedtls_aes_implementation` `mbedtls_des_context` `mbedtls_des3_context` Does _not_ privatize the types/macros: `MBEDTLS_ARIA_BLOCKSIZE` `MBEDTLS_ARIA_MAX_ROUNDS` `mbedtls_aes_context` `mbedls_aria_context` `mbedtls_camellia_context` `mbedtls_chacha20_context` `mbedtls_chachapoly_mode_t` `mbedtls_chachapoly_context` `mbedtls_poly1305_context` Resolves https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/225 ## 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
felixc-arm commented 2025-04-29 08:50:41 -05:00 (Migrated from github.com)

The OpenCI PR tests failed due to network stuff - I can't see a way to re-run them without updating the patch. Presumably the Internal CI has validated this PR but I don't know if the OpenCI PR tests need to pass for the PR to be merged?

The OpenCI PR tests failed due to network stuff - I can't see a way to re-run them without updating the patch. Presumably the Internal CI has validated this PR but I don't know if the OpenCI PR tests need to pass for the PR to be merged?
gilles-peskine-arm commented 2025-04-29 10:58:10 -05:00 (Migrated from github.com)

@felixc-arm Make sure you're logged in to an account associated with your GitHub account, then you'll see a rerun icon, or go to the job page and click “Build Now”.

I've gone and restarted this one.

@felixc-arm Make sure you're logged in [to an account associated with your GitHub account](https://github.com/Mbed-TLS/mbedtls-test/blob/main/developer_guide.md#jenkins-instances), then you'll see a rerun icon, or go to the job page and click “Build Now”. I've gone and restarted this one.
bjwtaylor (Migrated from github.com) reviewed 2025-05-06 07:08:31 -05:00
@ -35,9 +35,11 @@
#include <stddef.h>
bjwtaylor (Migrated from github.com) commented 2025-05-06 07:06:43 -05:00

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

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

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

Can we add the /* MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS */ comment onto here?
@ -22,18 +22,23 @@
#include <stddef.h>
bjwtaylor (Migrated from github.com) commented 2025-05-06 07:08:03 -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) commented 2025-05-06 07:08:09 -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:15:16 -05:00
valeriosetti (Migrated from github.com) approved these changes 2025-05-09 08:09:02 -05:00
gilles-peskine-arm commented 2025-05-12 02:55:26 -05:00 (Migrated from github.com)

OpenCI failed due to https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/286. I've restarted the build.

OpenCI failed due to https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/286. I've restarted the build.
felixc-arm commented 2025-05-12 04:00:05 -05:00 (Migrated from github.com)

@gilles-peskine-arm I think this need a rebase to pass due to https://github.com/Mbed-TLS/TF-PSA-Crypto/pull/212 & its corresponding mbedtls PR, so I've done that & hopefully it will all be green...

@gilles-peskine-arm I think this need a rebase to pass due to https://github.com/Mbed-TLS/TF-PSA-Crypto/pull/212 & its corresponding `mbedtls` PR, so I've done that & hopefully it will all be green...
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!271
No description provided.