SHA1 / SHA256 and HMAC-SHA1 / HMAC-SHA256 Hash library
SHA1 / SHA256 and HMAC-SHA1 / HMACSHA256 Hash library
sha1_config.h
1 #ifndef Sha1_config_h
2 #define Sha1_config_h
3 #include <string.h>
4 
5 #if (defined(__linux) || defined(linux)) && !defined(__ARDUINO_x86__)
6  #define SHA1_LINUX
7  #include <stdint.h>
8  #include <stdio.h>
9  #include <stdlib.h>
10  #include <sys/time.h>
11  #include <unistd.h>
12 #else
13  #include "arduino.h"
14 #endif
15 
16 #if (defined(__linux) || defined(linux)) || defined(__ARDUINO_X86__)
17  #define memcpy_P memcpy
18  #undef PROGMEM
19  #define PROGMEM __attribute__(( section(".progmem.data") ))
20  #define pgm_read_dword(p) (*(p))
21  #if defined(__ARDUINO_X86__)
22  #include "Print.h"
23  #endif
24  #if defined(SHA_LINUX)
25  double millis();
26  #endif
27 #else
28  #include <avr/io.h>
29  #include <avr/pgmspace.h>
30  #include "Print.h"
31 #endif
32 
33 #include <inttypes.h>
34 
35 #define HASH_LENGTH 20
36 #define BLOCK_LENGTH 64
37 
38 #endif