aes_common.h
1 /*
2  * Copyright (C) 2022 HAW Hamburg
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef AES_COMMON_H
21 #define AES_COMMON_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include "psa/crypto.h"
28 #include "crypto/modes/cbc.h"
29 
36 psa_status_t cipher_to_psa_error(int error);
37 
43 psa_status_t cbc_aes_common_encrypt_decrypt(cipher_t *ctx,
44  const uint8_t *key_buffer,
45  size_t key_buffer_size,
46  const uint8_t *iv,
47  const uint8_t *input,
48  size_t input_length,
49  uint8_t *output,
50  size_t *output_length,
51  psa_encrypt_or_decrypt_t direction);
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif /* AES_COMMON_H */
Cipher block chaining mode of operation for block ciphers.
Function declarations for PSA Crypto.
psa_encrypt_or_decrypt_t
For encrypt-decrypt functions, whether the operation is an encryption or a decryption.
Definition: crypto_types.h:37
int32_t psa_status_t
Status code type used for all PSA Certified APIs.
Definition: error.h:41
basic struct for using block ciphers contains the cipher interface and the context
Definition: ciphers.h:119