Hi Wang,
there's only one corner case when CSEC_DRV_GenerateMAC doesn't work as expected - when the size is a multiple of 256KB. This limitation will be published in next errata release.
But if you use size different from n*256KB, it works as expected.
CSEC_DRV_GenerateMACAddrMode does not have this limitation.
I tested it in the past and I got the same results when calling:
error_code = CSEC_DRV_GenerateMACAddrMode(CSEC_RAM_KEY, 0x50000, size, cmacAddrMode);
error_code = CSEC_DRV_GenerateMAC(CSEC_RAM_KEY, 0x50000, size, cmac, 1000);
Regards,
Lukas