SWCU194 March 2023 CC1314R10 , CC1354P10 , CC1354R10 , CC2674P10 , CC2674R10
For CBC-MAC operations, the following configuration parameters are required:
The input data can end misaligned for CBC-MAC operations. If this is the case, the crypto core internally pads the last input data block.
The length field can have any value. If a data stream is finished and the next data stream uses the same key and control, writing only a part of the next context is not allowed. A new data stream must always write the complete context. The length field must never be written with zeroes.
For CMAC operations, AESKEY2_n and AESKEY3_n must be written.
For all CBC-MAC operations, the data may end misaligned. If this is the case, the last data block must be padded as follows:
For regular CBC-MAC operations, the host must pad the input data to a 128-bit boundary with zeroes. More formally, the padding must satisfy the bit string: 0n, with 0 ≤ n ≤127, since the EIP-120t only supports bytes, (n MOD 8) = 0.
For CMAC operations, the host must pad the input data to a 128-bit boundary with a string that satisfies 1·0n , with 0 ≤ n <127. Because the EIP-39 only supports bytes, n must be such that (n MOD 8) = 7.
For regular CBC-MAC operations, the CRYPTO:AESDATALENn register can have any value but for CMAC operations, the actual length of the entire message or of the last data block, must be programmed. This is because the message length MOD 16 is used for selecting the key to use for the last round. The AESDATALENn register may never be written with zeroes. To support the degenerate case of CMAC on the empty message, program the length to 1 instead. The data block to be loaded consists of only padding then. If a message MAC is complete and the next message uses the same key and control, writing only a part of the next context is not allowed; a new message operation must always write the complete context.