Smart-Home am Beispiel der Präsenzerkennung im Raum Projektarbeit Lennart Heimbs, Johannes Krug, Sebastian Dohle und Kevin Holzschuh bei Prof. Oliver Hofmann SS2019
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AES_config.h 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* code was modified by george spanos <spaniakos@gmail.com>
  2. * 16/12/14
  3. */
  4. #ifndef __AES_CONFIG_H__
  5. #define __AES_CONFIG_H__
  6. #if (defined(__linux) || defined(linux)) && !defined(__ARDUINO_X86__)
  7. #define AES_LINUX
  8. #include <stdint.h>
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <string.h>
  12. #include <sys/time.h>
  13. #include <unistd.h>
  14. #else
  15. #include <Arduino.h>
  16. #endif
  17. #include <stdint.h>
  18. #include <string.h>
  19. #if defined(__ARDUINO_X86__) || (defined (__linux) || defined (linux))
  20. #undef PROGMEM
  21. #define PROGMEM __attribute__(( section(".progmem.data") ))
  22. #define pgm_read_byte(p) (*(p))
  23. typedef unsigned char byte;
  24. #define printf_P printf
  25. #define PSTR(x) (x)
  26. #elif defined(ARDUINO_ARCH_ESP8266)
  27. #include <pgmspace.h>
  28. #elif defined(ARDUINO_ARCH_ESP32)
  29. #include <pgmspace.h>
  30. #elif defined(ARDUINO_ARCH_SAMD)
  31. #define printf_P printf
  32. #else
  33. #include <avr/pgmspace.h>
  34. #endif
  35. #define N_ROW 4
  36. #define N_COL 4
  37. #define N_BLOCK (N_ROW * N_COL)
  38. #define N_MAX_ROUNDS 14
  39. #define KEY_SCHEDULE_BYTES ((N_MAX_ROUNDS + 1) * N_BLOCK)
  40. #define AES_SUCCESS (0)
  41. #define AES_FAILURE (-1)
  42. #endif