nRF Connect SDK API 3.4.99
Loading...
Searching...
No Matches

◆ cracen_sw_cbc_mac_update()

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().

Parameters
blkciphBlock cipher struct.
keyThe AES key reference.
mac_stateCBC-MAC state (16 bytes), updated in place.
partialBuffered partial block (16 bytes).
partial_lenBytes in partial.
inputInput.
lengthNumber of bytes.
keep_lastKeep the last block buffered even when it is full, until more input follows (for CMAC, which treats the last block apart).
Return values
psa_status_tPSA_SUCCESS on success, error code otherwise.