30#ifndef CRYPTO_MBEDTLS4_H_
31#define CRYPTO_MBEDTLS4_H_
33#include <psa/crypto.h>
38#define OPENVPN_MAX_IV_LENGTH 16
41#define OPENVPN_MODE_CBC PSA_ALG_CBC_PKCS7
44#define OPENVPN_MODE_OFB PSA_ALG_OFB
47#define OPENVPN_MODE_CFB PSA_ALG_CFB
50#define OPENVPN_MODE_GCM PSA_ALG_GCM
55#define OPENVPN_OP_ENCRYPT 0
58#define OPENVPN_OP_DECRYPT 1
60#define MD4_DIGEST_LENGTH 16
61#define MD5_DIGEST_LENGTH 16
62#define SHA_DIGEST_LENGTH 20
63#define SHA256_DIGEST_LENGTH 32
85 mbedtls_svc_key_id_t
key;
160#define mbed_ok(errval) mbed_log_func_line_lite(D_CRYPT_ERRORS, errval, __func__, __LINE__)
static bool mbed_log_func_line_lite(unsigned int flags, int errval, const char *func, int line)
Wraps mbed_log_func_line() to prevent function calls for non-errors.
struct hmac_ctx hmac_ctx_t
struct cipher_info cipher_info_t
bool mbed_log_err(unsigned int flags, int errval, const char *prefix)
Log the supplied mbed TLS error, prefixed by supplied prefix.
struct cipher_ctx cipher_ctx_t
union psa_cipher_or_aead_operation cipher_operation_t
bool mbed_log_func_line(unsigned int flags, int errval, const char *func, int line)
Log the supplied mbed TLS error, prefixed by function name and line number.
cipher_operation_t operation
psa_key_attributes_t key_attributes
const cipher_info_t * cipher_info
psa_key_type_t psa_key_type
const md_info_t * md_info
psa_mac_operation_t operation
psa_key_attributes_t key_attributes
const md_info_t * md_info
psa_hash_operation_t operation
psa_aead_operation_t aead
psa_cipher_operation_t cipher