uint8_t plainKey[] = {0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB,0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB};
CSEC_DRV_Init(&csecState);
CSEC_DRV_LoadPlainKey(plainKey);
CSEC_DRV_GenerateMAC(CSEC_RAM_KEY, msg, msg_len, cmac, &timeout);
*I use 179 byte message as msg, so msg_len=179.
*16 byte output buffer as cmac.
*timout = 0;
I used same parameters in different libraries to confirm if SDK calculates the right value;
mbedtls calculated a different cmac signature than SDK.
python cryptography library calculated same cmac signature with mbedtls.
a web tool calculated the same signature with mbedtls.
What could be the problem here?
What am I possibly doing wrong?
已解决! 转到解答。