summaryrefslogtreecommitdiff
path: root/plugins/MirOTR/Libgcrypt/cipher/hash-common.h
diff options
context:
space:
mode:
authorRené Schümann <white06tiger@gmail.com>2015-03-20 12:32:29 +0000
committerRené Schümann <white06tiger@gmail.com>2015-03-20 12:32:29 +0000
commit539705d58fc39a28388ff18c695dd406f4ffd1d9 (patch)
tree51db7a37a66c09f41734ba5573d972aae9f30d71 /plugins/MirOTR/Libgcrypt/cipher/hash-common.h
parent90171f125f36488dc08f5cfe0b0d4b78d995f08d (diff)
MirOTR: Libgcrypt and Libgpg-error update
Libgcrypt 1.4.6 => 1.6.3 Libgpg-error 1.9 => 1.18 git-svn-id: http://svn.miranda-ng.org/main/trunk@12449 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/Libgcrypt/cipher/hash-common.h')
-rw-r--r--plugins/MirOTR/Libgcrypt/cipher/hash-common.h31
1 files changed, 28 insertions, 3 deletions
diff --git a/plugins/MirOTR/Libgcrypt/cipher/hash-common.h b/plugins/MirOTR/Libgcrypt/cipher/hash-common.h
index 9c4e333594..aa95365a8c 100644
--- a/plugins/MirOTR/Libgcrypt/cipher/hash-common.h
+++ b/plugins/MirOTR/Libgcrypt/cipher/hash-common.h
@@ -20,14 +20,39 @@
#ifndef GCRY_HASH_COMMON_H
#define GCRY_HASH_COMMON_H
+#include "types.h"
-const char * _gcry_hash_selftest_check_one
-/**/ (int algo,
+
+const char * _gcry_hash_selftest_check_one
+/**/ (int algo,
int datamode, const void *data, size_t datalen,
const void *expect, size_t expectlen);
-
+/* Type for the md_write helper function. */
+typedef unsigned int (*_gcry_md_block_write_t) (void *c,
+ const unsigned char *buf);
+
+#if defined(HAVE_U64_TYPEDEF) && (defined(USE_SHA512) || defined(USE_WHIRLPOOL))
+/* SHA-512 needs u64 and larger buffer. Whirlpool needs u64. */
+# define MD_BLOCK_MAX_BLOCKSIZE 128
+# define MD_NBLOCKS_TYPE u64
+#else
+# define MD_BLOCK_MAX_BLOCKSIZE 64
+# define MD_NBLOCKS_TYPE u32
+#endif
+
+typedef struct gcry_md_block_ctx
+{
+ byte buf[MD_BLOCK_MAX_BLOCKSIZE];
+ MD_NBLOCKS_TYPE nblocks;
+ MD_NBLOCKS_TYPE nblocks_high;
+ int count;
+ size_t blocksize;
+ _gcry_md_block_write_t bwrite;
+} gcry_md_block_ctx_t;
+void
+_gcry_md_block_write( void *context, const void *inbuf_arg, size_t inlen);
#endif /*GCRY_HASH_COMMON_H*/