S32K116 - CSEC_DRV_GenerateMAC Calculates Signature Different than other sources

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K116 - CSEC_DRV_GenerateMAC Calculates Signature Different than other sources

ソリューションへジャンプ
516件の閲覧回数
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?

 

タグ(2)
0 件の賞賛
1 解決策
496件の閲覧回数
muhammetkalayci
Contributor II

alright I solved it.

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

元の投稿で解決策を見る

0 件の賞賛
1 返信
497件の閲覧回数
muhammetkalayci
Contributor II

alright I solved it.

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

0 件の賞賛