2025-03-11 5:42 AM
Hello, I've got STM32H53 MCU and trying to use hardware CCM accelerator as alternative CCM for mbedtls library.
I've took HAL implementation from the repository STM32Cube_FW_H7_V1.11.2/Projects/STM32H743I-EVAL/Applications/mbedTLS/Crypto_Selftest/Src/ccm_alt.c and it's not working as well as mbedtls software implementation.
I'll try to describe that behavior by the examples below.
Encryption by mbedtls_ccm_encrypt_and_tag():
size_t length = 62
size_t add_len = 35
size_t iv_len = 13
size_t tag_len = 8
Output buffer matched, output tag unmatched to mbedtld software encryption
size_t length = 112
size_t add_len = 36
size_t iv_len = 13
size_t tag_len = 8
Output buffer matched, output tag matched to mbedtld software encryption
size_t length = 119
size_t add_len = 42
size_t iv_len = 13
size_t tag_len = 8
Output buffer matched, output tag unmatched to mbedtld software encryption
size_t length = 0
size_t add_len = 36
size_t iv_len = 13
size_t tag_len = 8
Output buffer matched, output tag matched to mbedtld software encryption
size_t length = 1544
size_t add_len = 42
size_t iv_len = 13
size_t tag_len = 8
Output buffer matched, output tag unmatched to mbedtld software encryption
Decryption by mbedtls_ccm_auth_decrypt():
size_t length = 62
size_t add_len = 35
size_t iv_len = 13
size_t tag_len = 8
Output buffer matched, output tag matched to mbedtld software decryption
size_t length = 112
size_t add_len = 36
size_t iv_len = 13
size_t tag_len = 8
Output buffer matched, output tag matched to mbedtld software decryption
size_t length = 119
size_t add_len = 42
size_t iv_len = 13
size_t tag_len = 8
Output buffer matched, output tag matched to mbedtld software decryption
size_t length = 0
size_t add_len = 36
size_t iv_len = 13
size_t tag_len = 8
Output buffer matched, output tag matched to mbedtld software decryption
size_t length = 1544
size_t add_len = 42
size_t iv_len = 13
size_t tag_len = 8
Output buffer matched, output tag unmatched to mbedtld software decryption
Thanks in advance, I'll happy to see any tips or solutions.
2025-03-11 6:43 AM
UPD: Sorry, I've got some mistakes here, any Red word means "unmatched"