psa_periph_chacha20_ctx.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2024 TU Dresden
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #include "crys_chacha.h"
24 #include "kernel_defines.h"
25 
26 #if IS_USED(MODULE_PERIPH_CIPHER_CHACHA20) || DOXYGEN
39 typedef struct {
40  uint8_t buffer[CRYS_CHACHA_BLOCK_SIZE_IN_BYTES];
41  uint8_t buffer_length;
42  union {
43  CRYS_CHACHA_EncryptMode_t mode;
44  CRYS_CHACHAUserContext_t post_setup;
45  } ctx;
47 
48 #endif
49 
50 #ifdef __cplusplus
51 }
52 #endif
Common macros and compiler attributes/pragmas configuration.
This struct is used to handle the discontinuity between the PSA API and the CRYS ChaCha20 API.
uint8_t buffer_length
Current length of the data in buffer.
CRYS_CHACHAUserContext_t post_setup
Context of the CRYS ChaCha20 operation.
CRYS_CHACHA_EncryptMode_t mode
Mode of the operation.