diff options
Diffstat (limited to 'libtomcrypt/hashes')
| -rw-r--r-- | libtomcrypt/hashes/hash_memory.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libtomcrypt/hashes/hash_memory.c b/libtomcrypt/hashes/hash_memory.c index 274c208..13e7d36 100644 --- a/libtomcrypt/hashes/hash_memory.c +++ b/libtomcrypt/hashes/hash_memory.c @@ -19,14 +19,14 @@ /** Hash a block of memory and store the digest. - @param hash The index of the hash you wish to use + @param hash The hash you wish to use @param in The data you wish to hash @param inlen The length of the data to hash (octets) @param out [out] Where to store the digest @param outlen [in/out] Max size and resulting size of the digest @return CRYPT_OK if successful */ -int hash_memory(int hash, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) +int hash_memory(const struct algo_properties_st *hash, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) { int err; struct hash_data hdata; @@ -36,17 +36,17 @@ int hash_memory(int hash, const unsigned char *in, unsigned long inlen, unsigned 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; |
