diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 7d2047f516..b9ea209c0c 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -269,6 +269,7 @@ headers = \ safe-mkstemp.h \ sendfile-util.h \ seq-range-array.h \ + sha-common.h \ sha1.h \ sha2.h \ sort.h \ diff --git a/src/lib/sha-common.h b/src/lib/sha-common.h new file mode 100644 index 0000000000..47c58feac1 --- /dev/null +++ b/src/lib/sha-common.h @@ -0,0 +1,9 @@ +#ifndef SHA_COMMON + +#define SHA256_RESULTLEN (256 / 8) +#define SHA256_BLOCK_SIZE (512 / 8) + +#define SHA512_RESULTLEN (512 / 8) +#define SHA512_BLOCK_SIZE (1024 / 8) + +#endif diff --git a/src/lib/sha2.h b/src/lib/sha2.h index b04f93ae5a..5d9d2f0b04 100644 --- a/src/lib/sha2.h +++ b/src/lib/sha2.h @@ -35,12 +35,7 @@ #define SHA2_H #include "hash-method.h" - -#define SHA256_RESULTLEN (256 / 8) -#define SHA256_BLOCK_SIZE (512 / 8) - -#define SHA512_RESULTLEN (512 / 8) -#define SHA512_BLOCK_SIZE (1024 / 8) +#include "sha-common.h" struct sha256_ctx { size_t tot_len;