2020-2021 Sunseeker Telemetry and Lighting System
aes.h
Go to the documentation of this file.
1 //*****************************************************************************
2 //
3 // aes.h - Driver for the AES Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_AES_H__
8 #define __MSP430WARE_AES_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_AES__
13 
14 //*****************************************************************************
15 //
16 // If building with a C++ compiler, make all of the definitions in this header
17 // have a C binding.
18 //
19 //*****************************************************************************
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 //*****************************************************************************
26 //
27 // The following are values that can be passed toThe following are values that
28 // can be returned by the AES_isBusy() function.
29 //
30 //*****************************************************************************
31 #define AES_BUSY AESBUSY
32 #define AES_NOT_BUSY 0x00
33 
34 //*****************************************************************************
35 //
36 // The following are values that can be passed toThe following are values that
37 // can be returned by the AES_getErrorFlagStatus() function.
38 //
39 //*****************************************************************************
40 #define AES_ERROR_OCCURRED AESERRFG
41 #define AES_NO_ERROR 0x00
42 
43 //*****************************************************************************
44 //
45 // Prototypes for the APIs.
46 //
47 //*****************************************************************************
48 
49 //*****************************************************************************
50 //
60 //
61 //*****************************************************************************
62 extern uint8_t AES_setCipherKey(uint16_t baseAddress,
63  const uint8_t *CipherKey);
64 
65 //*****************************************************************************
66 //
79 //
80 //*****************************************************************************
81 extern uint8_t AES_encryptData(uint16_t baseAddress,
82  const uint8_t *Data,
83  uint8_t *encryptedData);
84 
85 //*****************************************************************************
86 //
100 //
101 //*****************************************************************************
102 extern uint8_t AES_decryptData(uint16_t baseAddress,
103  const uint8_t *Data,
104  uint8_t *decryptedData);
105 
106 //*****************************************************************************
107 //
118 //
119 //*****************************************************************************
120 extern uint8_t AES_setDecipherKey(uint16_t baseAddress,
121  const uint8_t *CipherKey);
122 
123 //*****************************************************************************
124 //
137 //
138 //*****************************************************************************
139 extern void AES_clearInterrupt(uint16_t baseAddress);
140 
141 //*****************************************************************************
142 //
152 //
153 //*****************************************************************************
154 extern uint32_t AES_getInterruptStatus(uint16_t baseAddress);
155 
156 //*****************************************************************************
157 //
168 //
169 //*****************************************************************************
170 extern void AES_enableInterrupt(uint16_t baseAddress);
171 
172 //*****************************************************************************
173 //
184 //
185 //*****************************************************************************
186 extern void AES_disableInterrupt(uint16_t baseAddress);
187 
188 //*****************************************************************************
189 //
200 //
201 //*****************************************************************************
202 extern void AES_reset(uint16_t baseAddress);
203 
204 //*****************************************************************************
205 //
221 //
222 //*****************************************************************************
223 extern uint8_t AES_startEncryptData(uint16_t baseAddress,
224  const uint8_t *Data,
225  uint8_t *encryptedData);
226 
227 //*****************************************************************************
228 //
243 //
244 //*****************************************************************************
245 extern uint8_t AES_startDecryptData(uint16_t baseAddress,
246  const uint8_t *Data);
247 
248 //*****************************************************************************
249 //
261 //
262 //*****************************************************************************
263 extern uint8_t AES_startSetDecipherKey(uint16_t baseAddress,
264  const uint8_t *CipherKey);
265 
266 //*****************************************************************************
267 //
280 //
281 //*****************************************************************************
282 extern uint8_t AES_getDataOut(uint16_t baseAddress,
283  uint8_t *OutputData);
284 
285 //*****************************************************************************
286 //
299 //
300 //*****************************************************************************
301 extern uint8_t AES_isBusy(uint16_t baseAddress);
302 
303 //*****************************************************************************
304 //
316 //
317 //*****************************************************************************
318 extern void AES_clearErrorFlag(uint16_t baseAddress);
319 
320 //*****************************************************************************
321 //
335 //
336 //*****************************************************************************
337 extern uint32_t AES_getErrorFlagStatus(uint16_t baseAddress);
338 
339 //*****************************************************************************
340 //
352 //
353 //*****************************************************************************
354 extern uint8_t AES_startDecryptDataUsingEncryptionKey(uint16_t baseAddress,
355  const uint8_t *Data);
356 
357 //*****************************************************************************
358 //
371 //
372 //*****************************************************************************
373 extern uint8_t AES_decryptDataUsingEncryptionKey(uint16_t baseAddress,
374  const uint8_t *Data,
375  uint8_t *decryptedData);
376 
377 //*****************************************************************************
378 //
379 // Mark the end of the C bindings section for C++ compilers.
380 //
381 //*****************************************************************************
382 #ifdef __cplusplus
383 }
384 #endif
385 
386 #endif
387 #endif // __MSP430WARE_AES_H__
uint16_t Data
uint8_t CipherKey[32]