Hi @soulyoung
I confirmed there's a bug in the SDK driver.
It won't work if the message length is:
from 641 to 768
from 1537 to 1664
from 2433 to 2560
etc.
There's wrong logic when writing MAC to CSEC PRAM memory.
The SDK is not maintained anymore, so it won't be updated. But you can fix it like this:
Find CSEC_DRV_StartVerifMACCmd function in csec_driver.c and replace this line:
if ((macOffset + CSEC_PAGE_SIZE_IN_BYTES) < CSEC_DATA_BYTES_AVAILABLE)
with this line:
if ((g_csecStatePtr->fullSize - g_csecStatePtr->index) <= (CSEC_DATA_BYTES_AVAILABLE - CSEC_PAGE_SIZE_IN_BYTES))
Then it should work.
Regards,
Lukas