S32K116 - CSEC_DRV_GenerateMAC Calculates Signature Different than other sources

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K116 - CSEC_DRV_GenerateMAC Calculates Signature Different than other sources

Jump to solution
498 Views
muhammetkalayci
Contributor II

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?

 

Tags (2)
0 Kudos
1 Solution
478 Views
muhammetkalayci
Contributor II

alright I solved it.

msg_len must be in bits... so in my case it must be 179*8...

View solution in original post

0 Kudos
1 Reply
479 Views
muhammetkalayci
Contributor II

alright I solved it.

msg_len must be in bits... so in my case it must be 179*8...

0 Kudos