nrfxlib API 2.8.99
Loading...
Searching...
No Matches
aes_alt.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef MBEDTLS_AES_ALT_H
8#define MBEDTLS_AES_ALT_H
9
10
11#if defined(MBEDTLS_CONFIG_FILE)
12#include MBEDTLS_CONFIG_FILE
13#endif
14
15
16#include <stddef.h>
17#include <stdint.h>
18
19#if defined(MBEDTLS_AES_ALT)
20
21
22/* padlock.c and aesni.c rely on these values! */
23#define MBEDTLS_AES_ENCRYPT 1
24#define MBEDTLS_AES_DECRYPT 0
26/* Error codes in range 0x0020-0x0022 */
27#define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -0x0020
28#define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -0x0022
30/* Error codes in range 0x0023-0x0025 */
31#define MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE -0x0023
32#define MBEDTLS_ERR_AES_HW_ACCEL_FAILED -0x0025
35/* The Size of the AES context.*/
36#define MBEDTLS_AES_CONTEXT_SIZE_IN_WORDS (29)
37
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
47typedef struct
48{
49 uint32_t buf[MBEDTLS_AES_CONTEXT_SIZE_IN_WORDS];
50} mbedtls_aes_context;
51
52
53#if defined(MBEDTLS_CIPHER_MODE_XTS)
57typedef struct mbedtls_aes_xts_context
58{
59 mbedtls_aes_context crypt;
61 mbedtls_aes_context tweak;
63} mbedtls_aes_xts_context;
64#endif /* MBEDTLS_CIPHER_MODE_XTS */
65
66#ifdef __cplusplus
67}
68#endif
69
70#endif /* MBEDTLS_AES_ALT */
71
72#endif /* MBEDTLS_AES_ALT_H */