Hi everyone,
I use S32K116-EVB and trying to generate CMAC using these values:
key : 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00
Message : 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
After CMAC generation on EVB, using an external AES-CMAC calculation code and generated another CMAC with same values. (External AES-CMAC implementation from official RFC-4493 document.)
However when i try to match two generated CMAC values, i find that they are different.
So, what is different between offical AES-CMAC calculation and S32K CSEc CMAC calculation?
Why these two values do not match?
Hi @BrK_
please take a look at my last answer in this thread:
https://community.nxp.com/t5/S32K/S32K116-Bricked-after-CSEc-Operations/m-p/1179670
I was able to get correct result when using test vectors provided by SHE spec. It just depends if you use SDK or if you use code from AN5401 - the drivers use different data format.
Regards,
Lukas
Hi @lukaszadrapa ,
Thank you for reply but i guess the problem is not mentioned in the solution.
As you can see with additional pictures SHE spec vectors specified 8bit words. Also you can see test key, message and API which generate CMAC.
Regards,
Hi @lukaszadrapa,
Thank you for reply.
I have another issue.
I have an cmac value for a binary code file. Code size is 7308byte.
I defined this cmac value in my csec code and loaded it as boot_mac via debug RAM.
Then i debug the RAM again to enable secure boot.
The size variable that the CSEC_DRV_BootDefine function takes is defined as follows,
As a result, secure boot gives an error as boot_mac_key_missmatched.
I follows these steps :
* Operate flash partition for csec via Debug Ram.
* Define master_ecu_key, boot_mac_key, boot_mac via Debug Ram.
* Loade code into Flash.
* Define secure boot with CSEC_DRV_BootDefine via Debug Ram.
* Reset device.
I'm waiting for your feedback.
Regards,