@@ -99,18 +99,20 @@ typedef enum aes_intlvl {
99
99
/* AES interrupt callback function pointer. */
100
100
typedef void (* aes_callback_t )(void );
101
101
102
+ #define CRYPTO_AES128_STRUCT_ATTR __attribute((aligned(1)))
103
+
102
104
typedef struct {
103
105
CryptoAESDec_t ProcessingMode ;
104
106
uint8_t ProcessingDelay ; // [0,15]
105
107
CryptoAESAuto_t StartMode ;
106
108
unsigned char OpMode ; // 0 = ECB, 1 = CBC, 2 = OFB, 3 = CFB, 4 = CTR
107
109
CryptoAESXor_t XorMode ;
108
- } CryptoAESConfig_t ;
110
+ } CryptoAESConfig_t CRYPTO_AES128_STRUCT_ATTR ;
109
111
110
112
typedef struct {
111
113
unsigned char datrdy ; // ENABLE/DISABLE; Data ready interrupt
112
114
unsigned char urad ; // ENABLE/DISABLE; Unspecified Register Access Detection
113
- } CryptoAES_ISRConfig_t ;
115
+ } CryptoAES_ISRConfig_t CRYPTO_AES128_STRUCT_ATTR ;
114
116
115
117
/* AES encryption complete. */
116
118
#define AES_ENCRYPTION_COMPLETE (1UL << 0)
@@ -149,15 +151,15 @@ typedef uint8_t (*CryptoAESFuncType)(uint8_t *, uint8_t *, uint8_t *);
149
151
typedef struct {
150
152
CryptoAESFuncType cryptFunc ;
151
153
uint16_t blockSize ;
152
- } CryptoAES_CBCSpec_t ;
154
+ } CryptoAES_CBCSpec_t CRYPTO_AES128_STRUCT_ATTR ;
153
155
156
+ #ifdef ENABLE_CRYPTO_TESTS
154
157
void CryptoAES_CBCSend (uint16_t Count , void * Plaintext , void * Ciphertext ,
155
158
uint8_t * IV , uint8_t * Key ,
156
159
CryptoAES_CBCSpec_t CryptoSpec );
157
160
void CryptoAES_CBCRecv (uint16_t Count , void * Plaintext , void * Ciphertext ,
158
161
uint8_t * IV , uint8_t * Key ,
159
162
CryptoAES_CBCSpec_t CryptoSpec );
160
-
161
163
void CryptoAESEncrypt_CBCSend (uint16_t Count , uint8_t * PlainText , uint8_t * CipherText ,
162
164
uint8_t * Key , uint8_t * IV );
163
165
void CryptoAESDecrypt_CBCSend (uint16_t Count , uint8_t * PlainText , uint8_t * CipherText ,
@@ -166,6 +168,7 @@ void CryptoAESEncrypt_CBCReceive(uint16_t Count, uint8_t *PlainText, uint8_t *Ci
166
168
uint8_t * Key , uint8_t * IV );
167
169
void CryptoAESDecrypt_CBCReceive (uint16_t Count , uint8_t * PlainText , uint8_t * CipherText ,
168
170
uint8_t * Key , uint8_t * IV );
171
+ #endif
169
172
170
173
/* Crypto utility functions: */
171
174
#define CRYPTO_BYTES_TO_BLOCKS (numBytes , blockSize ) \
0 commit comments