Loading...
Searching...
No Matches
block_cipher.h
Go to the documentation of this file.
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/
#ifndef MBEDTLS_BLOCK_CIPHER_H
#define MBEDTLS_BLOCK_CIPHER_H
#include "mbedtls/private_access.h"
#include "mbedtls/build_info.h"
#if defined(MBEDTLS_AES_C)
#include "mbedtls/aes.h"
#endif
#if defined(MBEDTLS_ARIA_C)
#include "mbedtls/aria.h"
#endif
#if defined(MBEDTLS_CAMELLIA_C)
#include "mbedtls/camellia.h"
#endif
#if defined(MBEDTLS_BLOCK_CIPHER_SOME_PSA)
#include "psa/crypto_types.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
MBEDTLS_BLOCK_CIPHER_ID_NONE = 0,
MBEDTLS_BLOCK_CIPHER_ID_AES,
MBEDTLS_BLOCK_CIPHER_ID_CAMELLIA,
MBEDTLS_BLOCK_CIPHER_ID_ARIA,
} mbedtls_block_cipher_id_t;
typedef enum {
MBEDTLS_BLOCK_CIPHER_ENGINE_LEGACY = 0,
MBEDTLS_BLOCK_CIPHER_ENGINE_PSA,
} mbedtls_block_cipher_engine_t;
typedef struct {
mbedtls_block_cipher_id_t MBEDTLS_PRIVATE(id);
#if defined(MBEDTLS_BLOCK_CIPHER_SOME_PSA)
mbedtls_block_cipher_engine_t MBEDTLS_PRIVATE(engine);
mbedtls_svc_key_id_t MBEDTLS_PRIVATE(psa_key_id);
#endif
union {
unsigned dummy; /* Make the union non-empty even with no supported algorithms. */
#if defined(MBEDTLS_AES_C)
mbedtls_aes_context MBEDTLS_PRIVATE(aes);
#endif
#if defined(MBEDTLS_ARIA_C)
mbedtls_aria_context MBEDTLS_PRIVATE(aria);
#endif
#if defined(MBEDTLS_CAMELLIA_C)
mbedtls_camellia_context MBEDTLS_PRIVATE(camellia);
#endif
} MBEDTLS_PRIVATE(ctx);
} mbedtls_block_cipher_context_t;
#ifdef __cplusplus
}
#endif
#endif /* MBEDTLS_BLOCK_CIPHER_H */
aes.h
This file contains AES definitions and functions.
aria.h
ARIA block cipher.
mbedtls_block_cipher_engine_t
mbedtls_block_cipher_engine_t
Definition block_cipher.h:47
MBEDTLS_BLOCK_CIPHER_ENGINE_LEGACY
@ MBEDTLS_BLOCK_CIPHER_ENGINE_LEGACY
Definition block_cipher.h:48
MBEDTLS_BLOCK_CIPHER_ENGINE_PSA
@ MBEDTLS_BLOCK_CIPHER_ENGINE_PSA
Definition block_cipher.h:49
mbedtls_block_cipher_id_t
mbedtls_block_cipher_id_t
Definition block_cipher.h:35
MBEDTLS_BLOCK_CIPHER_ID_AES
@ MBEDTLS_BLOCK_CIPHER_ID_AES
Definition block_cipher.h:37
MBEDTLS_BLOCK_CIPHER_ID_ARIA
@ MBEDTLS_BLOCK_CIPHER_ID_ARIA
Definition block_cipher.h:39
MBEDTLS_BLOCK_CIPHER_ID_CAMELLIA
@ MBEDTLS_BLOCK_CIPHER_ID_CAMELLIA
Definition block_cipher.h:38
MBEDTLS_BLOCK_CIPHER_ID_NONE
@ MBEDTLS_BLOCK_CIPHER_ID_NONE
Definition block_cipher.h:36
camellia.h
Camellia block cipher.
crypto_types.h
PSA cryptography module: type aliases.
mbedtls_svc_key_id_t
psa_key_id_t mbedtls_svc_key_id_t
Definition crypto_types.h:292
build_info.h
Build-time configuration info.
private_access.h
Macro wrapper for struct's members.
MBEDTLS_PRIVATE
#define MBEDTLS_PRIVATE(member)
Definition private_access.h:15
mbedtls_aes_context
The AES context-type definition.
Definition aes.h:63
mbedtls_aria_context
The ARIA context-type definition.
Definition aria.h:52
mbedtls_block_cipher_context_t
Definition block_cipher.h:52
mbedtls_block_cipher_context_t::dummy
unsigned dummy
Definition block_cipher.h:59
mbedtls_camellia_context
CAMELLIA context structure.
Definition camellia.h:41