tm4c129_crypto_cipher.h
Go to the documentation of this file.
1 /**
2  * @file tm4c129_crypto_cipher.h
3  * @brief Tiva TM4C129 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.0
29  **/
30 
31 #ifndef _TM4C129_CRYPTO_CIPHER_H
32 #define _TM4C129_CRYPTO_CIPHER_H
33 
34 //Dependencies
35 #include "core/crypto.h"
36 
37 //Cipher hardware accelerator
38 #ifndef TM4C129_CRYPTO_CIPHER_SUPPORT
39  #define TM4C129_CRYPTO_CIPHER_SUPPORT DISABLED
40 #elif (TM4C129_CRYPTO_CIPHER_SUPPORT != ENABLED && TM4C129_CRYPTO_CIPHER_SUPPORT != DISABLED)
41  #error TM4C129_CRYPTO_CIPHER_SUPPORT parameter is not valid
42 #endif
43 
44 //AES engine registers
45 #ifndef AES_KEY2_6_R
46  #define AES_KEY2_6_R HWREG(AES_BASE + AES_O_KEY2_6)
47  #define AES_KEY2_7_R HWREG(AES_BASE + AES_O_KEY2_7)
48  #define AES_KEY2_4_R HWREG(AES_BASE + AES_O_KEY2_4)
49  #define AES_KEY2_5_R HWREG(AES_BASE + AES_O_KEY2_5)
50  #define AES_KEY2_2_R HWREG(AES_BASE + AES_O_KEY2_2)
51  #define AES_KEY2_3_R HWREG(AES_BASE + AES_O_KEY2_3)
52  #define AES_KEY2_0_R HWREG(AES_BASE + AES_O_KEY2_0)
53  #define AES_KEY2_1_R HWREG(AES_BASE + AES_O_KEY2_1)
54  #define AES_KEY1_6_R HWREG(AES_BASE + AES_O_KEY1_6)
55  #define AES_KEY1_7_R HWREG(AES_BASE + AES_O_KEY1_7)
56  #define AES_KEY1_4_R HWREG(AES_BASE + AES_O_KEY1_4)
57  #define AES_KEY1_5_R HWREG(AES_BASE + AES_O_KEY1_5)
58  #define AES_KEY1_2_R HWREG(AES_BASE + AES_O_KEY1_2)
59  #define AES_KEY1_3_R HWREG(AES_BASE + AES_O_KEY1_3)
60  #define AES_KEY1_0_R HWREG(AES_BASE + AES_O_KEY1_0)
61  #define AES_KEY1_1_R HWREG(AES_BASE + AES_O_KEY1_1)
62  #define AES_IV_IN_0_R HWREG(AES_BASE + AES_O_IV_IN_0)
63  #define AES_IV_IN_1_R HWREG(AES_BASE + AES_O_IV_IN_1)
64  #define AES_IV_IN_2_R HWREG(AES_BASE + AES_O_IV_IN_2)
65  #define AES_IV_IN_3_R HWREG(AES_BASE + AES_O_IV_IN_3)
66  #define AES_CTRL_R HWREG(AES_BASE + AES_O_CTRL)
67  #define AES_C_LENGTH_0_R HWREG(AES_BASE + AES_O_C_LENGTH_0)
68  #define AES_C_LENGTH_1_R HWREG(AES_BASE + AES_O_C_LENGTH_1)
69  #define AES_AUTH_LENGTH_R HWREG(AES_BASE + AES_O_AUTH_LENGTH)
70  #define AES_DATA_IN_0_R HWREG(AES_BASE + AES_O_DATA_IN_0)
71  #define AES_DATA_IN_1_R HWREG(AES_BASE + AES_O_DATA_IN_1)
72  #define AES_DATA_IN_2_R HWREG(AES_BASE + AES_O_DATA_IN_2)
73  #define AES_DATA_IN_3_R HWREG(AES_BASE + AES_O_DATA_IN_3)
74  #define AES_TAG_OUT_0_R HWREG(AES_BASE + AES_O_TAG_OUT_0)
75  #define AES_TAG_OUT_1_R HWREG(AES_BASE + AES_O_TAG_OUT_1)
76  #define AES_TAG_OUT_2_R HWREG(AES_BASE + AES_O_TAG_OUT_2)
77  #define AES_TAG_OUT_3_R HWREG(AES_BASE + AES_O_TAG_OUT_3)
78  #define AES_REVISION_R HWREG(AES_BASE + AES_O_REVISION)
79  #define AES_SYSCONFIG_R HWREG(AES_BASE + AES_O_SYSCONFIG)
80  #define AES_SYSSTATUS_R HWREG(AES_BASE + AES_O_SYSSTATUS)
81  #define AES_IRQSTATUS_R HWREG(AES_BASE + AES_O_IRQSTATUS)
82  #define AES_IRQENABLE_R HWREG(AES_BASE + AES_O_IRQENABLE)
83  #define AES_DIRTYBITS_R HWREG(AES_BASE + AES_O_DIRTYBITS)
84  #define AES_DMAIM_R HWREG(AES_BASE + AES_O_DMAIM)
85  #define AES_DMARIS_R HWREG(AES_BASE + AES_O_DMARIS)
86  #define AES_DMAMIS_R HWREG(AES_BASE + AES_O_DMAMIS)
87  #define AES_DMAIC_R HWREG(AES_BASE + AES_O_DMAIC)
88 #endif
89 
90 //DES engine registers
91 #ifndef DES_KEY3_L_R
92  #define DES_KEY3_L_R HWREG(DES_BASE + DES_O_KEY3_L)
93  #define DES_KEY3_H_R HWREG(DES_BASE + DES_O_KEY3_H)
94  #define DES_KEY2_L_R HWREG(DES_BASE + DES_O_KEY2_L)
95  #define DES_KEY2_H_R HWREG(DES_BASE + DES_O_KEY2_H)
96  #define DES_KEY1_L_R HWREG(DES_BASE + DES_O_KEY1_L)
97  #define DES_KEY1_H_R HWREG(DES_BASE + DES_O_KEY1_H)
98  #define DES_IV_L_R HWREG(DES_BASE + DES_O_IV_L)
99  #define DES_IV_H_R HWREG(DES_BASE + DES_O_IV_H)
100  #define DES_CTRL_R HWREG(DES_BASE + DES_O_CTRL)
101  #define DES_LENGTH_R HWREG(DES_BASE + DES_O_LENGTH)
102  #define DES_DATA_L_R HWREG(DES_BASE + DES_O_DATA_L)
103  #define DES_DATA_H_R HWREG(DES_BASE + DES_O_DATA_H)
104  #define DES_REVISION_R HWREG(DES_BASE + DES_O_REVISION)
105  #define DES_SYSCONFIG_R HWREG(DES_BASE + DES_O_SYSCONFIG)
106  #define DES_SYSSTATUS_R HWREG(DES_BASE + DES_O_SYSSTATUS)
107  #define DES_IRQSTATUS_R HWREG(DES_BASE + DES_O_IRQSTATUS)
108  #define DES_IRQENABLE_R HWREG(DES_BASE + DES_O_IRQENABLE)
109  #define DES_DIRTYBITS_R HWREG(DES_BASE + DES_O_DIRTYBITS)
110  #define DES_DMAIM_R HWREG(DES_BASE + DES_O_DMAIM)
111  #define DES_DMARIS_R HWREG(DES_BASE + DES_O_DMARIS)
112  #define DES_DMAMIS_R HWREG(DES_BASE + DES_O_DMAMIS)
113  #define DES_DMAIC_R HWREG(DES_BASE + DES_O_DMAIC)
114 #endif
115 
116 //C++ guard
117 #ifdef __cplusplus
118 extern "C" {
119 #endif
120 
121 //C++ guard
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif
General definitions for cryptographic algorithms.