summaryrefslogtreecommitdiffstats
path: root/libtomcrypt/hashes
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-07-24 02:59:33 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-07-24 04:25:24 +0200
commit06520b6a96ac44d1c4c6e999c5d5ec725d11afa5 (patch)
tree8b454b1c61e03d4e0927bd7e9446d8f2a58cf523 /libtomcrypt/hashes
parent51f5a84d2999239d305de3404e804273984d01e0 (diff)
Use algo_properties_st in hash_memory_multi
Diffstat (limited to 'libtomcrypt/hashes')
-rw-r--r--libtomcrypt/hashes/hash_memory_multi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libtomcrypt/hashes/hash_memory_multi.c b/libtomcrypt/hashes/hash_memory_multi.c
index 6a85f65..dd3b524 100644
--- a/libtomcrypt/hashes/hash_memory_multi.c
+++ b/libtomcrypt/hashes/hash_memory_multi.c
@@ -20,7 +20,7 @@
/**
Hash multiple (non-adjacent) blocks of memory at once.
- @param hash The index of the hash you wish to use
+ @param hash The hash you wish to use
@param out [out] Where to store the digest
@param outlen [in/out] Max size and resulting size of the digest
@param in The data you wish to hash
@@ -28,7 +28,7 @@
@param ... tuples of (data,len) pairs to hash, terminated with a (NULL,x) (x=don't care)
@return CRYPT_OK if successful
*/
-int hash_memory_multi(int hash, unsigned char *out, unsigned long *outlen,
+int hash_memory_multi(const struct algo_properties_st *hash, unsigned char *out, unsigned long *outlen,
const unsigned char *in, unsigned long inlen, ...)
{
struct hash_data hdata;
@@ -42,17 +42,17 @@ int hash_memory_multi(int hash, unsigned char *out, unsigned long *outlen,
LTC_ARGCHK(out != NULL);
LTC_ARGCHK(outlen != NULL);
- if ((err = hash_is_valid(hash)) != CRYPT_OK) {
+ if ((err = hash_is_valid(hash->algo)) != CRYPT_OK) {
return err;
}
- digest_size = _ncr_algo_digest_size(hash);
+ digest_size = _ncr_algo_digest_size(hash->algo);
if (*outlen < digest_size) {
*outlen = digest_size;
return CRYPT_BUFFER_OVERFLOW;
}
- err = cryptodev_hash_init( &hdata, _ncr_algo_to_str(hash), 0, NULL, 0);
+ err = cryptodev_hash_init( &hdata, _ncr_algo_to_str(hash->algo), 0, NULL, 0);
if (err < 0) {
err = CRYPT_INVALID_HASH;
goto LBL_ERR;