#include <subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_aead.h>
Encrypt and authenticate a message using AEAD.
- Parameters
-
| [in] | attributes | Key attributes. |
| [in] | key_buffer | Key material buffer. |
| [in] | key_buffer_size | Size of the key buffer in bytes. |
| [in] | alg | AEAD algorithm. |
| [in] | nonce | Nonce or IV. |
| [in] | nonce_length | Length of the nonce in bytes. |
| [in] | additional_data | Additional Authenticated Data (AAD). |
| [in] | additional_data_length | Length of Additional Authenticated Data (AAD) in bytes. |
| [in] | plaintext | Plaintext to encrypt. |
| [in] | plaintext_length | Length of the plaintext in bytes. |
| [out] | ciphertext | Buffer to store the ciphertext and tag. |
| [in] | ciphertext_size | Size of the ciphertext buffer in bytes. |
| [out] | ciphertext_length | Length of the generated ciphertext in bytes. |
- Return values
-
| PSA_SUCCESS | The operation completed successfully. |
| PSA_ERROR_INVALID_HANDLE | The key handle is invalid. |
| PSA_ERROR_NOT_SUPPORTED | The algorithm is not supported. |
| PSA_ERROR_BUFFER_TOO_SMALL | The ciphertext buffer is too small. |