Hello Shannon,
You can use the CSEC_DRV_GenerateMAC function in the SDK to generate the BOOT_MAC for the application you are trying to protect.
First of all, you need to load the RAM_KEY with the same value as BOOT_MAC_KEY, using CSEC_DRV_LoadPlainKey.
Then, you will need to invoke CSEC_DRV_GenerateMAC. The parameters will be the following:
- keyId - CSEC_RAM_KEY
- msg - Pointer to a buffer containing the DATA indicated in the note you mentioned (represented here as uint32_t words): 0 0 0 BOOT_SIZE PFLASH_DATA
- msgLen - BOOT_SIZE + 128
- cmac - Pointer to a buffer where the computed BOOT_MAC will be stored
- timeout - Timeout in milliseconds.
Please note that the BOOT_MAC can be automatically calculated by the CSEc module, avoiding the computation above (you can refer to chapter 4.4.3.2 in the application note).
Hope this helps!
Best regards,
Veronica