31#ifndef CRYPTO_MBEDTLS4_H_
32#define CRYPTO_MBEDTLS4_H_
34#include <psa/crypto.h>
39#define OPENVPN_MAX_IV_LENGTH 16
42#define OPENVPN_MODE_CBC PSA_ALG_CBC_PKCS7
45#define OPENVPN_MODE_OFB PSA_ALG_OFB
48#define OPENVPN_MODE_CFB PSA_ALG_CFB
51#define OPENVPN_MODE_GCM PSA_ALG_GCM
56#define OPENVPN_OP_ENCRYPT 0
59#define OPENVPN_OP_DECRYPT 1
61#define MD4_DIGEST_LENGTH 16
62#define MD5_DIGEST_LENGTH 16
63#define SHA_DIGEST_LENGTH 20
64#define SHA256_DIGEST_LENGTH 32
86 mbedtls_svc_key_id_t
key;
161#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