Arm Mbed OS support forum

SHA512/SHA384 not working on 32 bit architecture

In sha512.h there is undefined reference to uint64_t on 32 bit architecture:

typedef struct mbedtls_sha512_context
{
uint64_t total[2]; /*!< The number of Bytes processed. /
uint64_t state[8]; /
!< The intermediate digest state. /
unsigned char buffer[128]; /
!< The data block being processed. /
#if !defined(MBEDTLS_SHA512_NO_SHA384)
int is384; /
!< Determines which function to use:
0: Use SHA-512, or 1: Use SHA-384. */
#endif
}
mbedtls_sha512_context;

Is there a solution for this?

Hi,

AFAIK, uint64_t type is supported by C99 or C++11 spec in compiler regardless CPU architecture. You can check your compiler version and build options such as -std option.