40 #ifndef __DRIVERLIB_AES_H__
41 #define __DRIVERLIB_AES_H__
60 #define AES_CFG_DIR_ENCRYPT 0x00000004
61 #define AES_CFG_DIR_DECRYPT 0x00000000
69 #define AES_CFG_KEY_SIZE_128BIT 0x00000008
70 #define AES_CFG_KEY_SIZE_192BIT 0x00000010
71 #define AES_CFG_KEY_SIZE_256BIT 0x00000018
79 #define AES_CFG_MODE_M 0x2007fe60
80 #define AES_CFG_MODE_ECB 0x00000000
81 #define AES_CFG_MODE_CBC 0x00000020
82 #define AES_CFG_MODE_CTR 0x00000040
83 #define AES_CFG_MODE_ICM 0x00000200
84 #define AES_CFG_MODE_CFB 0x00000400
85 #define AES_CFG_MODE_XTS_TWEAKJL \
87 #define AES_CFG_MODE_XTS_K2IJL \
89 #define AES_CFG_MODE_XTS_K2ILJ0 \
91 #define AES_CFG_MODE_F8 0x00002000
92 #define AES_CFG_MODE_F9 0x20004000
93 #define AES_CFG_MODE_CBCMAC 0x20008000
94 #define AES_CFG_MODE_GCM_HLY0ZERO \
96 #define AES_CFG_MODE_GCM_HLY0CALC \
98 #define AES_CFG_MODE_GCM_HY0CALC \
100 #define AES_CFG_MODE_CCM 0x20040040
109 #define AES_CFG_CTR_WIDTH_32 0x00000000
110 #define AES_CFG_CTR_WIDTH_64 0x00000080
111 #define AES_CFG_CTR_WIDTH_96 0x00000100
112 #define AES_CFG_CTR_WIDTH_128 0x00000180
121 #define AES_CFG_CCM_L_1 0x00000000
122 #define AES_CFG_CCM_L_2 0x00080000
123 #define AES_CFG_CCM_L_3 0x00100000
124 #define AES_CFG_CCM_L_4 0x00180000
125 #define AES_CFG_CCM_L_5 0x00200000
126 #define AES_CFG_CCM_L_6 0x00280000
127 #define AES_CFG_CCM_L_7 0x00300000
128 #define AES_CFG_CCM_L_8 0x00380000
137 #define AES_CFG_CCM_M_4 0x00400000
138 #define AES_CFG_CCM_M_6 0x00800000
139 #define AES_CFG_CCM_M_8 0x00c00000
140 #define AES_CFG_CCM_M_10 0x01000000
141 #define AES_CFG_CCM_M_12 0x01400000
142 #define AES_CFG_CCM_M_14 0x01800000
143 #define AES_CFG_CCM_M_16 0x01c00000
151 #define AES_INT_CONTEXT_IN 0x00000001
152 #define AES_INT_CONTEXT_OUT 0x00000008
153 #define AES_INT_DATA_IN 0x00000002
154 #define AES_INT_DATA_OUT 0x00000004
155 #define AES_INT_DMA_CONTEXT_IN 0x00010000
156 #define AES_INT_DMA_CONTEXT_OUT 0x00080000
157 #define AES_INT_DMA_DATA_IN 0x00020000
158 #define AES_INT_DMA_DATA_OUT 0x00040000
166 #define AES_DMA_DATA_IN 0x00000020
167 #define AES_DMA_DATA_OUT 0x00000040
168 #define AES_DMA_CONTEXT_IN 0x00000080
169 #define AES_DMA_CONTEXT_OUT 0x00000100
177 extern void AESConfigSet(uint32_t ui32Base, uint32_t ui32Config);
178 extern void AESDataRead(uint32_t ui32Base, uint32_t *pui32Dest);
181 uint32_t *pui32Dest, uint32_t ui32Length);
182 extern bool AESDataAuth(uint32_t ui32Base, uint32_t *pui32Src,
183 uint32_t ui32Length, uint32_t *pui32Tag);
185 uint32_t *pui32Dest, uint32_t ui32Length,
186 uint32_t *pui32AuthSrc,
187 uint32_t ui32AuthLength, uint32_t *pui32Tag);
188 extern void AESDataWrite(uint32_t ui32Base, uint32_t *pui32Src);
190 extern void AESDMADisable(uint32_t ui32Base, uint32_t ui32Flags);
191 extern void AESDMAEnable(uint32_t ui32Base, uint32_t ui32Flags);
192 extern void AESIntClear(uint32_t ui32Base, uint32_t ui32IntFlags);
193 extern void AESIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags);
194 extern void AESIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags);
195 extern void AESIntRegister(uint32_t ui32Base,
void (*pfnHandler)(
void));
196 extern uint32_t
AESIntStatus(uint32_t ui32Base,
bool bMasked);
198 extern void AESIVSet(uint32_t ui32Base, uint32_t *pui32IVdata);
199 extern void AESIVRead(uint32_t ui32Base, uint32_t *pui32IVdata);
200 extern void AESKey1Set(uint32_t ui32Base, uint32_t *pui32Key,
201 uint32_t ui32Keysize);
202 extern void AESKey2Set(uint32_t ui32Base, uint32_t *pui32Key,
203 uint32_t ui32Keysize);
204 extern void AESKey3Set(uint32_t ui32Base, uint32_t *pui32Key);
205 extern void AESLengthSet(uint32_t ui32Base, uint64_t ui64Length);
206 extern void AESReset(uint32_t ui32Base);
207 extern void AESTagRead(uint32_t ui32Base, uint32_t *pui32TagData);
218 #endif // __DRIVERLIB_AES_H__
void AESDMAEnable(uint32_t ui32Base, uint32_t ui32Flags)
void AESIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
void AESKey1Set(uint32_t ui32Base, uint32_t *pui32Key, uint32_t ui32Keysize)
void AESLengthSet(uint32_t ui32Base, uint64_t ui64Length)
void AESIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
void AESConfigSet(uint32_t ui32Base, uint32_t ui32Config)
void AESAuthLengthSet(uint32_t ui32Base, uint32_t ui32Length)
void AESKey2Set(uint32_t ui32Base, uint32_t *pui32Key, uint32_t ui32Keysize)
bool AESDataProcessAuth(uint32_t ui32Base, uint32_t *pui32Src, uint32_t *pui32Dest, uint32_t ui32Length, uint32_t *pui32AuthSrc, uint32_t ui32AuthLength, uint32_t *pui32Tag)
void AESReset(uint32_t ui32Base)
bool AESDataReadNonBlocking(uint32_t ui32Base, uint32_t *pui32Dest)
void AESIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
void AESDataRead(uint32_t ui32Base, uint32_t *pui32Dest)
bool AESDataWriteNonBlocking(uint32_t ui32Base, uint32_t *pui32Src)
void AESTagRead(uint32_t ui32Base, uint32_t *pui32TagData)
void AESIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
void AESIVSet(uint32_t ui32Base, uint32_t *pui32IVdata)
void AESDataWrite(uint32_t ui32Base, uint32_t *pui32Src)
void AESIntUnregister(uint32_t ui32Base)
void AESDMADisable(uint32_t ui32Base, uint32_t ui32Flags)
void AESIVRead(uint32_t ui32Base, uint32_t *pui32IVdata)
uint32_t AESIntStatus(uint32_t ui32Base, bool bMasked)
bool AESDataAuth(uint32_t ui32Base, uint32_t *pui32Src, uint32_t ui32Length, uint32_t *pui32Tag)
bool AESDataProcess(uint32_t ui32Base, uint32_t *pui32Src, uint32_t *pui32Dest, uint32_t ui32Length)
void AESKey3Set(uint32_t ui32Base, uint32_t *pui32Key)