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

◆ cracen_mac_compute()

psa_status_t cracen_mac_compute ( const psa_key_attributes_t * attributes,
const uint8_t * key_buffer,
size_t key_buffer_size,
psa_algorithm_t alg,
const uint8_t * input,
size_t input_length,
uint8_t * mac,
size_t mac_size,
size_t * mac_length )

#include <subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_mac.h>

Compute a MAC in a single operation.

Parameters
[in]attributesKey attributes.
[in]key_bufferKey material buffer.
[in]key_buffer_sizeSize of the key buffer in bytes.
[in]algMAC algorithm.
[in]inputInput data to authenticate.
[in]input_lengthLength of the input data in bytes.
[out]macBuffer to store the MAC.
[in]mac_sizeSize of the MAC buffer in bytes.
[out]mac_lengthLength of the generated MAC in bytes.
Return values
PSA_SUCCESSThe operation completed successfully.
PSA_ERROR_INVALID_HANDLEThe key handle is invalid.
PSA_ERROR_NOT_SUPPORTEDThe algorithm is not supported.
PSA_ERROR_BUFFER_TOO_SMALLThe MAC buffer is too small.