HSE IVT Auth_TAG

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

HSE IVT Auth_TAG

1,809件の閲覧回数
liyongfeng
Contributor III

I used an offline tool to calculate the IVT GMAC, but the result differs from HSE's. I want to know how to obtain the same result based on applicationDebugKeyPassword[16U] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }?

liyongfeng_0-1747206681217.png

 

0 件の賞賛
返信
4 返答(返信)

1,788件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Please provide further details about used example codes and mentioned tool. Thanks

0 件の賞賛
返信

1,747件の閲覧回数
liyongfeng
Contributor III

applicationDebugKeyPassword=000102...0F;

How to calculate the red part below using an offline tool to obtain the blue part's GMAC?

A5 5A A5 5A 09 00 00 00 00 00 00 00 00 60 44 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
C0 40 40 00 00 00 00 00 00 00 00 00 00 00 00 00
FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 79 AB 16 44 70 B3 B6 3D 4E 35 70 C1
44 E3 5F FC 7B 5A 1A E4 55 B3 03 C8 87 FA 25 A4

if __name__ == '__main__':
key = b'000102030405060708090A0B0C0D0E0F'
iv = b'79AB164470B3B63D4E3570C1'
data = b'A55AA55A090000000000000000604400\
00000000000000000000000000000000\
00000000000000000000000000000000\
C0404000000000000000000000000000\
FFFFFFFF000000000000000000000000\
00000000000000000000000000000000\
00000000000000000000000000000000\
00000000000000000000000000000000\
00000000000000000000000000000000\
00000000000000000000000000000000\
00000000000000000000000000000000\
00000000000000000000000000000000\
00000000000000000000000000000000\
00000000000000000000000000000000\
0000000079AB164470B3B63D4E3570C1'
aesgcm = AESGCM(key)
gmac = aesgcm.encrypt(iv, data, None)[-16:] # Last 16 bytes are GMAC
print(gmac.hex())

output:d6a5196d7573dd9bd49e9fce08ebb73b
It is different from the 16-byte IVT.GMAC shown in the figure above.
 

 

0 件の賞賛
返信

1,660件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Potentially the issue could be that you are using ASCII characters in Python script but HSE uses direct bin values i.e. HEX numbers

0 件の賞賛
返信

1,672件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

COuld you clarify which HSE example code you are referring to? Or describe how you do it on MCU side?

0 件の賞賛
返信