From: Aki Tuomi Date: Sat, 5 Nov 2016 09:47:40 +0000 (+0200) Subject: lib: Move sha context and result size to new header X-Git-Tag: 2.2.27~199 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d29f070a5431f6fcd75772151a10cb052295c79f;p=thirdparty%2Fdovecot%2Fcore.git lib: Move sha context and result size to new header This is to prepare for SHA3 inclusion --- diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 55758e0e80..4a6b9f3857 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -266,6 +266,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;