Arm Mbed and Pelion Device Management support forum

Zeroize requirement for mbedtls_calloc

Hi Mbed TLS Support Team,
i work with a mbedtls_calloc macro-implementation from a FreeRTOS port which provide a non zeroized memory by default (0xA5A5A5A5).

In the mbedtls_mpi_grow function() data is allocated to a round number of limbs for the MPI structure (e.g. with the CHARS_TO_LIMBS macro).
Afterwards other functions use the original size of the data by exluding the zeros at the end. (e.g. in mbedtls_mpi_cmp_mpi())

Maybe a zeroize in mbedtls_mpi_grow function() or a note for the zeroize requirement next to
#define mbedtls_calloc MBEDTLS_PLATFORM_CALLOC_MACRO
in platform.h would be good.

Jürgen
mbedTLS 2.16.3
FreeRTOS 10.2.0 ARM CM4F port (heap_4.c)

My ignorance, don’t knew the calloc definition (…and initializes all its bits to zero).
Please close the topic:)