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

◆ cracen_aead_decrypt()

psa_status_t cracen_aead_decrypt ( const psa_key_attributes_t * attributes,
const uint8_t * key_buffer,
size_t key_buffer_size,
psa_algorithm_t alg,
const uint8_t * nonce,
size_t nonce_length,
const uint8_t * additional_data,
size_t additional_data_length,
const uint8_t * ciphertext,
size_t ciphertext_length,
uint8_t * plaintext,
size_t plaintext_size,
size_t * plaintext_length )

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

Authenticate and decrypt a message using AEAD.

Parameters
[in]attributesKey attributes.
[in]key_bufferKey material buffer.
[in]key_buffer_sizeSize of the key buffer in bytes.
[in]algAEAD algorithm.
[in]nonceNonce or IV.
[in]nonce_lengthLength of the nonce in bytes.
[in]additional_dataAdditional Authenticated Data (AAD).
[in]additional_data_lengthLength of Additional Authenticated Data (AAD) in bytes.
[in]ciphertextCiphertext and tag to decrypt.
[in]ciphertext_lengthLength of the ciphertext in bytes.
[out]plaintextBuffer to store the plaintext.
[in]plaintext_sizeSize of the plaintext buffer in bytes.
[out]plaintext_lengthLength of the decrypted plaintext in bytes.
Return values
PSA_SUCCESSThe operation completed successfully.
PSA_ERROR_INVALID_HANDLEThe key handle is invalid.
PSA_ERROR_INVALID_SIGNATUREThe authentication tag is invalid.
PSA_ERROR_NOT_SUPPORTEDThe algorithm is not supported.
PSA_ERROR_BUFFER_TOO_SMALLThe plaintext buffer is too small.