CC3200 Peripheral Driver Library User's Guide  1.2.0
des.h
1 //*****************************************************************************
2 //
3 // des.h
4 //
5 // Defines and Macros for the DES module.
6 //
7 // Copyright (C) 2014 Texas Instruments Incorporated - https://www.ti.com/
8 //
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions
12 // are met:
13 //
14 // Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the
20 // distribution.
21 //
22 // Neither the name of Texas Instruments Incorporated nor the names of
23 // its contributors may be used to endorse or promote products derived
24 // from this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 //*****************************************************************************
39 
40 #ifndef __DRIVERLIB_DES_H__
41 #define __DRIVERLIB_DES_H__
42 
43 //*****************************************************************************
44 //
45 // If building with a C++ compiler, make all of the definitions in this header
46 // have a C binding.
47 //
48 //*****************************************************************************
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #endif
53 
54 //*****************************************************************************
55 //
56 // The following defines are used to specify the direction with the
57 // ui32Config argument in the DESConfig() function. Only one is permitted.
58 //
59 //*****************************************************************************
60 #define DES_CFG_DIR_DECRYPT 0x00000000
61 #define DES_CFG_DIR_ENCRYPT 0x00000004
62 
63 //*****************************************************************************
64 //
65 // The following defines are used to specify the operational with the
66 // ui32Config argument in the DESConfig() function. Only one is permitted.
67 //
68 //*****************************************************************************
69 #define DES_CFG_MODE_ECB 0x00000000
70 #define DES_CFG_MODE_CBC 0x00000010
71 #define DES_CFG_MODE_CFB 0x00000020
72 
73 //*****************************************************************************
74 //
75 // The following defines are used to select between single DES and triple DES
76 // with the ui32Config argument in the DESConfig() function. Only one is
77 // permitted.
78 //
79 //*****************************************************************************
80 #define DES_CFG_SINGLE 0x00000000
81 #define DES_CFG_TRIPLE 0x00000008
82 
83 //*****************************************************************************
84 //
85 // The following defines are used with the DESIntEnable(), DESIntDisable() and
86 // DESIntStatus() functions.
87 //
88 //*****************************************************************************
89 #define DES_INT_CONTEXT_IN 0x00000001
90 #define DES_INT_DATA_IN 0x00000002
91 #define DES_INT_DATA_OUT 0x00000004
92 #define DES_INT_DMA_CONTEXT_IN 0x00010000
93 #define DES_INT_DMA_DATA_IN 0x00020000
94 #define DES_INT_DMA_DATA_OUT 0x00040000
95 
96 //*****************************************************************************
97 //
98 // The following defines are used with the DESEnableDMA() and DESDisableDMA()
99 // functions.
100 //
101 //*****************************************************************************
102 #define DES_DMA_CONTEXT_IN 0x00000080
103 #define DES_DMA_DATA_OUT 0x00000040
104 #define DES_DMA_DATA_IN 0x00000020
105 
106 //*****************************************************************************
107 //
108 // API Function prototypes
109 //
110 //*****************************************************************************
111 extern void DESConfigSet(uint32_t ui32Base, uint32_t ui32Config);
112 extern void DESDataRead(uint32_t ui32Base, uint8_t *pui8Dest,
113  uint8_t ui8Length);
114 extern bool DESDataReadNonBlocking(uint32_t ui32Base, uint8_t *pui8Dest,
115  uint8_t ui8Length);
116 extern bool DESDataProcess(uint32_t ui32Base, uint8_t *pui8Src,
117  uint8_t *pui8Dest, uint32_t ui32Length);
118 extern void DESDataWrite(uint32_t ui32Base, uint8_t *pui8Src,
119  uint8_t ui8Length);
120 extern bool DESDataWriteNonBlocking(uint32_t ui32Base, uint8_t *pui8Src,
121  uint8_t ui8Length);
122 extern void DESDMADisable(uint32_t ui32Base, uint32_t ui32Flags);
123 extern void DESDMAEnable(uint32_t ui32Base, uint32_t ui32Flags);
124 extern void DESIntClear(uint32_t ui32Base, uint32_t ui32IntFlags);
125 extern void DESIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags);
126 extern void DESIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags);
127 extern void DESIntRegister(uint32_t ui32Base, void(*pfnHandler)(void));
128 extern uint32_t DESIntStatus(uint32_t ui32Base, bool bMasked);
129 extern void DESIntUnregister(uint32_t ui32Base);
130 extern bool DESIVSet(uint32_t ui32Base, uint8_t *pui8IVdata);
131 extern void DESKeySet(uint32_t ui32Base, uint8_t *pui8Key);
132 extern void DESDataLengthSet(uint32_t ui32Base, uint32_t ui32Length);
133 
134 //*****************************************************************************
135 //
136 // Mark the end of the C bindings section for C++ compilers.
137 //
138 //*****************************************************************************
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif // __DRIVERLIB_DES_H__
void DESDMADisable(uint32_t ui32Base, uint32_t ui32Flags)
Definition: des.c:866
bool DESDataReadNonBlocking(uint32_t ui32Base, uint8_t *pui8Dest, uint8_t ui8Length)
Definition: des.c:244
bool DESDataWriteNonBlocking(uint32_t ui32Base, uint8_t *pui8Src, uint8_t ui8Length)
Definition: des.c:356
bool DESIVSet(uint32_t ui32Base, uint8_t *pui8IVdata)
Definition: des.c:171
void DESKeySet(uint32_t ui32Base, uint8_t *pui8Key)
Definition: des.c:128
uint32_t DESIntStatus(uint32_t ui32Base, bool bMasked)
Definition: des.c:591
void DESIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: des.c:639
void DESIntUnregister(uint32_t ui32Base)
Definition: des.c:796
void DESDataWrite(uint32_t ui32Base, uint8_t *pui8Src, uint8_t ui8Length)
Definition: des.c:418
void DESIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
Definition: des.c:762
void DESIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: des.c:723
void DESConfigSet(uint32_t ui32Base, uint32_t ui32Config)
Definition: des.c:94
void DESDataRead(uint32_t ui32Base, uint8_t *pui8Dest, uint8_t ui8Length)
Definition: des.c:304
void DESDataLengthSet(uint32_t ui32Base, uint32_t ui32Length)
Definition: des.c:216
bool DESDataProcess(uint32_t ui32Base, uint8_t *pui8Src, uint8_t *pui8Dest, uint32_t ui32Length)
Definition: des.c:481
void DESDMAEnable(uint32_t ui32Base, uint32_t ui32Flags)
Definition: des.c:832
void DESIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: des.c:681