From ada6106692c72168dbe4defd2ec44f273c670e88 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Wed, 7 Jul 2010 22:54:53 +0200 Subject: Several fixes. RSA key generation tested and works. --- libtomcrypt/hashes/hash_memory.c | 6 ++++++ libtomcrypt/hashes/hash_memory_multi.c | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'libtomcrypt/hashes') diff --git a/libtomcrypt/hashes/hash_memory.c b/libtomcrypt/hashes/hash_memory.c index 274c208..7c0aa4e 100644 --- a/libtomcrypt/hashes/hash_memory.c +++ b/libtomcrypt/hashes/hash_memory.c @@ -52,6 +52,12 @@ int hash_memory(int hash, const unsigned char *in, unsigned long inlen, unsigned goto LBL_ERR; } + err = cryptodev_hash_reset( &hdata); + if (err < 0) { + err = CRYPT_INVALID_HASH; + goto LBL_ERR; + } + if ((err = _cryptodev_hash_update(&hdata, in, inlen)) < 0) { err = CRYPT_ERROR; goto LBL_ERR; diff --git a/libtomcrypt/hashes/hash_memory_multi.c b/libtomcrypt/hashes/hash_memory_multi.c index 6a85f65..52e8076 100644 --- a/libtomcrypt/hashes/hash_memory_multi.c +++ b/libtomcrypt/hashes/hash_memory_multi.c @@ -58,6 +58,12 @@ int hash_memory_multi(int hash, unsigned char *out, unsigned long *outlen, goto LBL_ERR; } + err = cryptodev_hash_reset( &hdata); + if (err < 0) { + err = CRYPT_INVALID_HASH; + goto LBL_ERR; + } + va_start(args, inlen); curptr = in; curlen = inlen; -- cgit