mbed TLS v2.2.0
aesdrv.h
Go to the documentation of this file.
1 
22 #ifndef __SILICON_LABS_AESDRV_H
23 #define __SILICON_LABS_AESDRV_H
24 
25 #if !defined(MBEDTLS_CONFIG_FILE)
26 #include "config.h"
27 #else
28 #include MBEDTLS_CONFIG_FILE
29 #endif
30 
31 #include "em_device.h"
32 #if ( defined(CRYPTO_COUNT) && (CRYPTO_COUNT > 0) ) || \
33  ( defined(AES_COUNT) && (AES_COUNT > 0) )
34 
35 #include "mbedtls_ecode.h"
36 #include <stdint.h>
37 #include <stdbool.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /*******************************************************************************
44  ******************************* ERROR CODES **********************************
45  ******************************************************************************/
46 
47 #define MBEDTLS_ECODE_AESDRV_NOT_SUPPORTED ((int)MBEDTLS_ECODE_AESDRV_BASE | 0x1)
48 #define MBEDTLS_ECODE_AESDRV_AUTHENTICATION_FAILED ((int)MBEDTLS_ECODE_AESDRV_BASE | 0x2)
49 #define MBEDTLS_ECODE_AESDRV_OUT_OF_RESOURCES ((int)MBEDTLS_ECODE_AESDRV_BASE | 0x3)
50 #define MBEDTLS_ECODE_AESDRV_INVALID_PARAM ((int)MBEDTLS_ECODE_AESDRV_BASE | 0x4)
51 
52 /*******************************************************************************
53  ******************************* TYPEDEFS **********************************
54  ******************************************************************************/
55 
58 typedef enum
59 {
63 
65 typedef struct
66 {
67  unsigned int dmaChIn;
68  unsigned int dmaChOut;
70 
72 typedef union
73 {
76 
78 typedef void (*AESDRV_CtrCallback_t)(uint8_t *ctr);
79 
80 #if ( defined(CRYPTO_COUNT) && (CRYPTO_COUNT > 0) )
81 #include "cryptodrv.h"
82 
83 /* Main AESDRV context structure. */
84 typedef struct
85 {
96 
97 #elif ( defined(AES_COUNT) && (AES_COUNT > 0) )
98 
99 typedef struct
100 {
101  uint32_t ccmCounter[4];
103 
104 #endif
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #endif /* #if ( defined(CRYPTO_COUNT) && (CRYPTO_COUNT > 0) ) || \
111  ( defined(AES_COUNT) && (AES_COUNT > 0) ) */
112 
113 #endif /* __SILICON_LABS_AESDRV_H */
CRYPTODRV_Context_t cryptodrvContext
CRYPTO driver context.
Definition: aesdrv.h:86
Data I/O mode specific configuration structure.
Definition: aesdrv.h:72
AESDRV_IoMode_t ioMode
Data I/O mode.
Definition: aesdrv.h:87
Compatibility names (set of defines)
AESDRV_DmaConfig_t dmaConfig
Definition: aesdrv.h:74
Silicon Labs specific mbedtls error code definitions.
Core CPU moves data to/from the data registers.
Definition: aesdrv.h:61
DMA I/O mode specific configuration structure.
Definition: aesdrv.h:65
AESDRV_IoModeSpecific_t ioModeSpecific
Data I/O mode specific config.
Definition: aesdrv.h:88
AESDRV_IoMode_t
Enum defines which data I/O mode to use for moving data to/from the AES/CRYPTO hardware module...
Definition: aesdrv.h:58
unsigned int dmaChOut
DMA output channel.
Definition: aesdrv.h:68
void(* AESDRV_CtrCallback_t)(uint8_t *ctr)
Prototype of counter callback function provided by user.
Definition: aesdrv.h:78
CRYPTODRV operation context.
Definition: cryptodrv.h:98
unsigned int dmaChIn
DMA input channel.
Definition: aesdrv.h:67
bool authTagOptimize
Enable/disable optimized handling of authentication tag in CCM/GCM.
Definition: aesdrv.h:90