Skip to content

Conversation

@de-nordic
Copy link
Contributor

Two commits from upstream:

  • split of encryption headers
  • change in encryption context, where there is no longer raw key stored in encryption context, instead context setup function has been setup to import key into PSA and obtain psa_key_id_t key id for it that is then stored in context; all encryption functions will now operate on that key_id, when using the context.

Replacement of raw key array in encryption context, with psa_key_id_t, has reduced MCUboot binary size by ~224 bytes, for non-KMU and non-log-dbg build; small amount of RAM is saved also.

return mbedtls_aes_setkey_enc(ctx, k, BOOT_ENC_KEY_SIZE * 8);
}

static inline int bootutil_aes_ctr_encrypt(bootutil_aes_ctr_context *ctx, uint8_t *counter, const uint8_t *m, uint32_t mlen, size_t blk_off, uint8_t *c)
Copy link
Contributor

@tomchy tomchy Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, I'd prefer to have docstrings inside the interface header, but since this is a [fromtree] commit, I'm not going to require them at this stage.

@de-nordic de-nordic requested a review from nordicjm November 13, 2025 11:22
Split definitions to crypto backend specific headers.

Signed-off-by: Dominik Ermel <[email protected]>
(cherry picked from commit 5a161e4cc1cd5329c073d996f0300d2661c6b768)
Store psa_key_id_t key in AES context instead of RAW key.

Signed-off-by: Dominik Ermel <[email protected]>
(cherry picked from commit e92551838e18b6219af0891a18a757e538bd3ff6)
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants