]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Move sha context and result size to new header
authorAki Tuomi <aki.tuomi@dovecot.fi>
Sat, 5 Nov 2016 09:47:40 +0000 (11:47 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 9 Nov 2016 12:40:58 +0000 (14:40 +0200)
This is to prepare for SHA3 inclusion

src/lib/Makefile.am
src/lib/sha-common.h [new file with mode: 0644]
src/lib/sha2.h

index 55758e0e8032ce9bd34bbfb8e572314f09cef12f..4a6b9f3857d12d7593c24bd23f317db866d436f0 100644 (file)
@@ -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 (file)
index 0000000..47c58fe
--- /dev/null
@@ -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
index b04f93ae5a0d0076ca4684ce0e55a8b0ac180418..5d9d2f0b04a7074aea27f8e9a04cabcb6923f6da 100644 (file)
 #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;