f2838x_crypto_cipher.h
Go to the documentation of this file.
1 /**
2  * @file f2838x_crypto_cipher.h
3  * @brief TMS320F2838xD cipher hardware accelerator
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneCRYPTO Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _F2838X_CRYPTO_CIPHER_H
32 #define _F2838X_CRYPTO_CIPHER_H
33 
34 //Dependencies
35 #include "core/crypto.h"
36 
37 //Cipher hardware accelerator
38 #ifndef F2838X_CRYPTO_CIPHER_SUPPORT
39  #define F2838X_CRYPTO_CIPHER_SUPPORT DISABLED
40 #elif (F2838X_CRYPTO_CIPHER_SUPPORT != ENABLED && F2838X_CRYPTO_CIPHER_SUPPORT != DISABLED)
41  #error F2838X_CRYPTO_CIPHER_SUPPORT parameter is not valid
42 #endif
43 
44 //AES engine registers
45 #define AES_KEY2_6_R HWREG(AES_BASE + AES_O_KEY2_6)
46 #define AES_KEY2_7_R HWREG(AES_BASE + AES_O_KEY2_7)
47 #define AES_KEY2_4_R HWREG(AES_BASE + AES_O_KEY2_4)
48 #define AES_KEY2_5_R HWREG(AES_BASE + AES_O_KEY2_5)
49 #define AES_KEY2_2_R HWREG(AES_BASE + AES_O_KEY2_2)
50 #define AES_KEY2_3_R HWREG(AES_BASE + AES_O_KEY2_3)
51 #define AES_KEY2_0_R HWREG(AES_BASE + AES_O_KEY2_0)
52 #define AES_KEY2_1_R HWREG(AES_BASE + AES_O_KEY2_1)
53 #define AES_KEY1_6_R HWREG(AES_BASE + AES_O_KEY1_6)
54 #define AES_KEY1_7_R HWREG(AES_BASE + AES_O_KEY1_7)
55 #define AES_KEY1_4_R HWREG(AES_BASE + AES_O_KEY1_4)
56 #define AES_KEY1_5_R HWREG(AES_BASE + AES_O_KEY1_5)
57 #define AES_KEY1_2_R HWREG(AES_BASE + AES_O_KEY1_2)
58 #define AES_KEY1_3_R HWREG(AES_BASE + AES_O_KEY1_3)
59 #define AES_KEY1_0_R HWREG(AES_BASE + AES_O_KEY1_0)
60 #define AES_KEY1_1_R HWREG(AES_BASE + AES_O_KEY1_1)
61 #define AES_IV_IN_OUT_0_R HWREG(AES_BASE + AES_O_IV_IN_OUT_0)
62 #define AES_IV_IN_OUT_1_R HWREG(AES_BASE + AES_O_IV_IN_OUT_1)
63 #define AES_IV_IN_OUT_2_R HWREG(AES_BASE + AES_O_IV_IN_OUT_2)
64 #define AES_IV_IN_OUT_3_R HWREG(AES_BASE + AES_O_IV_IN_OUT_3)
65 #define AES_CTRL_R HWREG(AES_BASE + AES_O_CTRL)
66 #define AES_C_LENGTH_0_R HWREG(AES_BASE + AES_O_C_LENGTH_0)
67 #define AES_C_LENGTH_1_R HWREG(AES_BASE + AES_O_C_LENGTH_1)
68 #define AES_AUTH_LENGTH_R HWREG(AES_BASE + AES_O_AUTH_LENGTH)
69 #define AES_DATA_IN_OUT_0_R HWREG(AES_BASE + AES_O_DATA_IN_OUT_0)
70 #define AES_DATA_IN_OUT_1_R HWREG(AES_BASE + AES_O_DATA_IN_OUT_1)
71 #define AES_DATA_IN_OUT_2_R HWREG(AES_BASE + AES_O_DATA_IN_OUT_2)
72 #define AES_DATA_IN_OUT_3_R HWREG(AES_BASE + AES_O_DATA_IN_OUT_3)
73 #define AES_TAG_OUT_0_R HWREG(AES_BASE + AES_O_TAG_OUT_0)
74 #define AES_TAG_OUT_1_R HWREG(AES_BASE + AES_O_TAG_OUT_1)
75 #define AES_TAG_OUT_2_R HWREG(AES_BASE + AES_O_TAG_OUT_2)
76 #define AES_TAG_OUT_3_R HWREG(AES_BASE + AES_O_TAG_OUT_3)
77 #define AES_REVISION_R HWREG(AES_BASE + AES_O_REVISION)
78 #define AES_SYSCONFIG_R HWREG(AES_BASE + AES_O_SYSCONFIG)
79 #define AES_SYSSTATUS_R HWREG(AES_BASE + AES_O_SYSSTATUS)
80 #define AES_IRQSTATUS_R HWREG(AES_BASE + AES_O_IRQSTATUS)
81 #define AES_IRQENABLE_R HWREG(AES_BASE + AES_O_IRQENABLE)
82 #define AES_DIRTYBITS_R HWREG(AES_BASE + AES_O_DIRTYBITS)
83 #define AES_DMAIM_R HWREG(AES_BASE + AES_O_DMAIM)
84 #define AES_DMARIS_R HWREG(AES_BASE + AES_O_DMARIS)
85 #define AES_DMAMIS_R HWREG(AES_BASE + AES_O_DMAMIS)
86 #define AES_DMAIC_R HWREG(AES_BASE + AES_O_DMAIC)
87 
88 //C++ guard
89 #ifdef __cplusplus
90 extern "C" {
91 #endif
92 
93 //C++ guard
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif
General definitions for cryptographic algorithms.