![]() |
nRF Connect SDK API 3.4.99
|
| psa_status_t cracen_sw_cbc_mac_update | ( | struct sxblkcipher * | blkciph, |
| const struct sxkeyref * | key, | ||
| uint8_t * | mac_state, | ||
| uint8_t * | partial, | ||
| size_t * | partial_len, | ||
| const uint8_t * | input, | ||
| size_t | length, | ||
| bool | keep_last ) |
#include <cracen_sw_common.h>
CBC-MAC over a byte stream.
Complete blocks are absorbed into mac_state with up to CRACEN_SW_AES_BATCH_BLOCKS blocks per CRACEN job, as AES-CBC encryption with the MAC state as IV. A trailing partial block is kept in partial. CRACEN must be reserved by the caller, as for cracen_sw_aes_primitive().
| blkciph | Block cipher struct. |
| key | The AES key reference. |
| mac_state | CBC-MAC state (16 bytes), updated in place. |
| partial | Buffered partial block (16 bytes). |
| partial_len | Bytes in partial. |
| input | Input. |
| length | Number of bytes. |
| keep_last | Keep the last block buffered even when it is full, until more input follows (for CMAC, which treats the last block apart). |
| psa_status_t | PSA_SUCCESS on success, error code otherwise. |