Mbed TLS v2.28.8
include
psa
crypto_builtin_composites.h
Go to the documentation of this file.
1
/*
2
* Context structure declaration of the Mbed TLS software-based PSA drivers
3
* called through the PSA Crypto driver dispatch layer.
4
* This file contains the context structures of those algorithms which need to
5
* rely on other algorithms, i.e. are 'composite' algorithms.
6
*
7
* \note This file may not be included directly. Applications must
8
* include psa/crypto.h.
9
*
10
* \note This header and its content is not part of the Mbed TLS API and
11
* applications must not depend on it. Its main purpose is to define the
12
* multi-part state objects of the Mbed TLS software-based PSA drivers. The
13
* definition of these objects are then used by crypto_struct.h to define the
14
* implementation-defined types of PSA multi-part state objects.
15
*/
16
/*
17
* Copyright The Mbed TLS Contributors
18
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
19
*/
20
21
#ifndef PSA_CRYPTO_BUILTIN_COMPOSITES_H
22
#define PSA_CRYPTO_BUILTIN_COMPOSITES_H
23
24
#include <
psa/crypto_driver_common.h
>
25
26
/*
27
* MAC multi-part operation definitions.
28
*/
29
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CMAC) || \
30
defined(MBEDTLS_PSA_BUILTIN_ALG_HMAC)
31
#define MBEDTLS_PSA_BUILTIN_MAC
32
#endif
33
34
#if defined(MBEDTLS_PSA_BUILTIN_ALG_GCM) || \
35
defined(MBEDTLS_PSA_BUILTIN_ALG_CCM) || \
36
defined(MBEDTLS_PSA_BUILTIN_ALG_CHACHA20_POLY1305)
37
#define MBEDTLS_PSA_BUILTIN_AEAD 1
38
#endif
39
40
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HMAC) || defined(PSA_CRYPTO_DRIVER_TEST)
41
typedef
struct
{
43
psa_algorithm_t
alg
;
45
struct
psa_hash_operation_s
hash_ctx;
47
uint8_t opad[
PSA_HMAC_MAX_HASH_BLOCK_SIZE
];
48
}
mbedtls_psa_hmac_operation_t
;
49
50
#define MBEDTLS_PSA_HMAC_OPERATION_INIT { 0, PSA_HASH_OPERATION_INIT, { 0 } }
51
#endif
/* MBEDTLS_PSA_BUILTIN_ALG_HMAC */
52
53
#include "
mbedtls/cmac.h
"
54
55
typedef
struct
{
56
psa_algorithm_t
alg
;
57
union
{
58
unsigned
dummy
;
/* Make the union non-empty even with no supported algorithms. */
59
#if defined(MBEDTLS_PSA_BUILTIN_ALG_HMAC) || defined(PSA_CRYPTO_DRIVER_TEST)
60
mbedtls_psa_hmac_operation_t
hmac
;
61
#endif
/* MBEDTLS_PSA_BUILTIN_ALG_HMAC */
62
#if defined(MBEDTLS_PSA_BUILTIN_ALG_CMAC) || defined(PSA_CRYPTO_DRIVER_TEST)
63
mbedtls_cipher_context_t
cmac
;
64
#endif
/* MBEDTLS_PSA_BUILTIN_ALG_CMAC */
65
}
ctx
;
66
}
mbedtls_psa_mac_operation_t
;
67
68
#define MBEDTLS_PSA_MAC_OPERATION_INIT { 0, { 0 } }
69
70
#endif
/* PSA_CRYPTO_BUILTIN_COMPOSITES_H */
crypto_driver_common.h
Definitions for all PSA crypto drivers.
PSA_HMAC_MAX_HASH_BLOCK_SIZE
#define PSA_HMAC_MAX_HASH_BLOCK_SIZE
Definition:
crypto_sizes.h:125
psa_hash_operation_s
Definition:
crypto_struct.h:71
mbedtls_psa_mac_operation_t
Definition:
crypto_builtin_composites.h:55
psa_hash_operation_s::ctx
psa_driver_hash_context_t ctx
Definition:
crypto_struct.h:79
psa_algorithm_t
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition:
crypto_types.h:125
mbedtls_psa_hmac_operation_t
Definition:
crypto_builtin_composites.h:41
mbedtls_psa_mac_operation_t::alg
psa_algorithm_t alg
Definition:
crypto_builtin_composites.h:56
mbedtls_cipher_context_t
Definition:
cipher.h:305
mbedtls_psa_mac_operation_t::dummy
unsigned dummy
Definition:
crypto_builtin_composites.h:58
mbedtls_psa_mac_operation_t::cmac
mbedtls_cipher_context_t cmac
Definition:
crypto_builtin_composites.h:63
cmac.h
This file contains CMAC definitions and functions.
mbedtls_psa_mac_operation_t::hmac
mbedtls_psa_hmac_operation_t hmac
Definition:
crypto_builtin_composites.h:60
mbedtls_psa_hmac_operation_t::alg
psa_algorithm_t alg
Definition:
crypto_builtin_composites.h:43
Generated on Wed Apr 24 2024 20:07:29 for Mbed TLS v2.28.8 by
1.8.17