summaryrefslogtreecommitdiff
path: root/cipher/rmd.h
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2013-09-18 13:50:35 +0200
committerWerner Koch <wk@gnupg.org>2013-09-18 14:19:53 +0200
commitecde77ad98690540abb21db08e5531297ed72bd0 (patch)
treed90afdb66d99caf5442cc92b0dec838e4f86aa34 /cipher/rmd.h
parent56b5949f71f501744998f5ebc12488ebf6f1c0b5 (diff)
downloadlibgcrypt-ecde77ad98690540abb21db08e5531297ed72bd0.tar.gz
Separate common md block code
* cipher/hash-common.c (_gcry_md_block_write): New function to handle block md operations. The current implementation is limited to 64 byte buffer and u32 block counter. * cipher/md4.c, cipher/md5.c, cipher/rmd.h, cipher/rmd160.c *cipher/sha1.c, cipher/sha256.c, cipher/tiger.c: Convert to use _gcry_md_block_write. -- Whirlpool and SHA512 are left as before, as SHA512 uses 128 bytes buffer and u64 blocks counter and Whirlpool does not have trivial block handling structure. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Indentation changes, minor edits and adjustment of _gcry_sha1_hash_buffers by wk.
Diffstat (limited to 'cipher/rmd.h')
-rw-r--r--cipher/rmd.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/cipher/rmd.h b/cipher/rmd.h
index 6a9fe313..a56ee49c 100644
--- a/cipher/rmd.h
+++ b/cipher/rmd.h
@@ -20,14 +20,13 @@
#ifndef G10_RMD_H
#define G10_RMD_H
+#include "hash-common.h"
/* We need this here because random.c must have direct access. */
typedef struct
{
+ gcry_md_block_ctx_t bctx;
u32 h0,h1,h2,h3,h4;
- u32 nblocks;
- byte buf[64];
- int count;
} RMD160_CONTEXT;
void _gcry_rmd160_init ( void *context );