Example CMAC computation using functions of the mcuxClKey and mcuxClMac component
#include <stdbool.h>
#include <internal/mcuxClMac_internal.h>
{
0x7c, 0x0b, 0x7d, 0xb9,
0x81, 0x1f, 0x10, 0xd0,
0x0e, 0x47, 0x6c, 0x7a,
0x0d, 0x92, 0xf6, 0xe0
};
size_t cmac_input_size_16 = 32u;
static uint8_t cmac_input16_in[] = {
0x1e, 0xe0, 0xec, 0x46,
0x6d, 0x46, 0xfd, 0x84,
0x9b, 0x40, 0xc0, 0x66,
0xb4, 0xfb, 0xbd, 0x22,
0xa2, 0x0a, 0x4d, 0x80,
0xa0, 0x08, 0xac, 0x9a,
0xf1, 0x7e, 0x4f, 0xdf,
0xd1, 0x06, 0x78, 0x5e
};
0xba, 0xec, 0xdc, 0x91,
0xe9, 0xa1, 0xfc, 0x35,
0x72, 0xad, 0xf1, 0xe4,
0x23, 0x2a, 0xe2, 0x85
};
return false;
return false;
pWa,
NULL,
NULL));
return false;
NULL,
0u));
return false;
cmac_key_properties));
return false;
key_buffer));
return false;
(uint8_t*)cmac_input16_in,
cmac_input_size_16,
result_buffer));
return false;
for (size_t i = 0U; i < sizeof(result_buffer); i++)
{
if (result_buffer[i] != cmac_output_reference16[i]) return false;
}
return false;
&session));
{
return false;
}
&session));
{
return false;
}
return false;
return true;
}