MySensors Library & Examples  2.3.2-62-ge298769
AES_config.h
1 /* code was modified by george spanos <[email protected]>
2  * 16/12/14
3  */
4 
5 #ifndef __AES_CONFIG_H__
6 #define __AES_CONFIG_H__
7 
8 #if (defined(__linux) || defined(linux)) && !defined(__ARDUINO_X86__)
9 
10 #define AES_LINUX
11 
12 #include <stdint.h>
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <string.h>
16 #include <sys/time.h>
17 #include <unistd.h>
18 #else
19 #include <Arduino.h>
20 #endif
21 
22 #include <stdint.h>
23 #include <string.h>
24 
25 #if defined(__ARDUINO_X86__) || (defined (__linux) || defined (linux))
26 #undef PROGMEM
27 #define PROGMEM __attribute__(( section(".progmem.data") ))
28 #define pgm_read_byte(p) (*(p))
29 typedef unsigned char byte;
30 #define printf_P printf
31 #define PSTR(x) (x)
32 #elif defined(ARDUINO_ARCH_ESP8266)
33 #include <pgmspace.h>
34 #elif defined(ARDUINO_ARCH_ESP32)
35 #include <pgmspace.h>
36 #elif defined(ARDUINO_ARCH_CUBECELL)
37 #include <pgmspace.h>
38 #elif defined(ARDUINO_ARCH_SAMD)
39 #define printf_P printf
40 #elif defined(__ASR6501__) || defined (__ASR6502__)
41 #include <pgmspace.h>
42 #else
43 #include <avr/pgmspace.h>
44 #endif
45 
46 #define N_ROW 4
47 #define N_COL 4
48 #define N_BLOCK (N_ROW * N_COL)
49 #define N_MAX_ROUNDS 14
50 #define KEY_SCHEDULE_BYTES ((N_MAX_ROUNDS + 1) * N_BLOCK)
51 #define AES_SUCCESS (0)
52 #define AES_FAILURE (-1)
53 
54 #endif