MySensors Library & Examples  2.3.2
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_SAMD)
37 #define printf_P printf
38 #else
39 #include <avr/pgmspace.h>
40 #endif
41 
42 #define N_ROW 4
43 #define N_COL 4
44 #define N_BLOCK (N_ROW * N_COL)
45 #define N_MAX_ROUNDS 14
46 #define KEY_SCHEDULE_BYTES ((N_MAX_ROUNDS + 1) * N_BLOCK)
47 #define AES_SUCCESS (0)
48 #define AES_FAILURE (-1)
49 
50 #endif