nrfxlib API 2.8.99
Loading...
Searching...
No Matches
cc3xx_psa_aead.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef CC3XX_PSA_AEAD_H
9#define CC3XX_PSA_AEAD_H
10
19#include "psa/crypto.h"
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
45psa_status_t
46cc3xx_aead_encrypt(const psa_key_attributes_t *attributes,
47 const uint8_t *key_buffer, size_t key_buffer_size,
48 psa_algorithm_t alg, const uint8_t *nonce,
49 size_t nonce_length, const uint8_t *additional_data,
50 size_t additional_data_length, const uint8_t *plaintext,
51 size_t plaintext_length, uint8_t *ciphertext,
52 size_t ciphertext_size, size_t *ciphertext_length);
53
74psa_status_t
75cc3xx_aead_decrypt(const psa_key_attributes_t *attributes,
76 const uint8_t *key_buffer, size_t key_buffer_size,
77 psa_algorithm_t alg, const uint8_t *nonce,
78 size_t nonce_length, const uint8_t *additional_data,
79 size_t additional_data_length, const uint8_t *ciphertext,
80 size_t ciphertext_length, uint8_t *plaintext,
81 size_t plaintext_size, size_t *plaintext_length);
82
100 cc3xx_aead_operation_t *operation,
101 const psa_key_attributes_t *attributes,
102 const uint8_t *key_buffer, size_t key_buffer_size,
103 psa_algorithm_t alg);
104
122 cc3xx_aead_operation_t *operation,
123 const psa_key_attributes_t *attributes,
124 const uint8_t *key_buffer, size_t key_buffer_size,
125 psa_algorithm_t alg);
126
142 cc3xx_aead_operation_t *operation,
143 const uint8_t *nonce,
144 size_t nonce_length);
145
159 cc3xx_aead_operation_t *operation,
160 size_t ad_length,
161 size_t plaintext_length);
162
177 cc3xx_aead_operation_t *operation,
178 const uint8_t *input,
179 size_t input_size);
180
197psa_status_t cc3xx_aead_update(
198 cc3xx_aead_operation_t *operation,
199 const uint8_t *input,
200 size_t input_length,
201 uint8_t *output,
202 size_t output_size,
203 size_t *output_length);
204
221psa_status_t cc3xx_aead_finish(
222 cc3xx_aead_operation_t *operation,
223 uint8_t *ciphertext,
224 size_t ciphertext_size,
225 size_t *ciphertext_length,
226 uint8_t *tag,
227 size_t tag_size,
228 size_t *tag_length);
229
245psa_status_t cc3xx_aead_verify(
246 cc3xx_aead_operation_t *operation,
247 uint8_t *plaintext,
248 size_t plaintext_size,
249 size_t *plaintext_length,
250 const uint8_t *tag,
251 size_t tag_size);
261
262#ifdef __cplusplus
263}
264#endif
265#endif /* CC3XX_PSA_AEAD_H */
psa_status_t cc3xx_aead_update_ad(cc3xx_aead_operation_t *operation, const uint8_t *input, size_t input_size)
Pass additional data to an active AEAD operation.
psa_status_t cc3xx_aead_encrypt_setup(cc3xx_aead_operation_t *operation, const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg)
Set the key for a multipart authenticated encryption operation.
psa_status_t cc3xx_aead_set_nonce(cc3xx_aead_operation_t *operation, const uint8_t *nonce, size_t nonce_length)
Set the nonce for an authenticated encryption or decryption operation.
psa_status_t cc3xx_aead_update(cc3xx_aead_operation_t *operation, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
Encrypt or decrypt a message fragment in an active AEAD operation.
psa_status_t cc3xx_aead_encrypt(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 *plaintext, size_t plaintext_length, uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length)
Encrypt and authenticate with an AEAD algorithm in one-shot.
psa_status_t cc3xx_aead_verify(cc3xx_aead_operation_t *operation, uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length, const uint8_t *tag, size_t tag_size)
Finish decrypting a message in an AEAD operation.
psa_status_t cc3xx_aead_set_lengths(cc3xx_aead_operation_t *operation, size_t ad_length, size_t plaintext_length)
Declare the lengths of the message and additional data for AEAD.
psa_status_t cc3xx_aead_abort(cc3xx_aead_operation_t *operation)
Abort an AEAD operation.
psa_status_t cc3xx_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)
Decrypt and verify tag with an AEAD algorithm in one-shot.
psa_status_t cc3xx_aead_decrypt_setup(cc3xx_aead_operation_t *operation, const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg)
Set the key for a multipart authenticated decryption operation.
psa_status_t cc3xx_aead_finish(cc3xx_aead_operation_t *operation, uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length, uint8_t *tag, size_t tag_size, size_t *tag_length)
Finish encrypting a message in an AEAD operation.
Definition cc3xx_crypto_primitives_private.h:26