diff options
| author | Miloslav Trmač <mitr@redhat.com> | 2010-07-24 03:07:56 +0200 |
|---|---|---|
| committer | Miloslav Trmač <mitr@redhat.com> | 2010-07-24 04:25:24 +0200 |
| commit | 94ad20f2978e7234579593ac284f9c6cd1426785 (patch) | |
| tree | b048aa7b4b0cd246b481eeddc6403250eddb73fe /libtomcrypt/hashes | |
| parent | 32e0115f32c75f0bffdea599734774376cdf097b (diff) | |
Replace _ncr_algo_digest_size by direct accesses
Diffstat (limited to 'libtomcrypt/hashes')
| -rw-r--r-- | libtomcrypt/hashes/hash_memory.c | 8 | ||||
| -rw-r--r-- | libtomcrypt/hashes/hash_memory_multi.c | 8 |
2 files changed, 6 insertions, 10 deletions
diff --git a/libtomcrypt/hashes/hash_memory.c b/libtomcrypt/hashes/hash_memory.c index 267957a..a452525 100644 --- a/libtomcrypt/hashes/hash_memory.c +++ b/libtomcrypt/hashes/hash_memory.c @@ -30,7 +30,6 @@ int hash_memory(const struct algo_properties_st *hash, const unsigned char *in, { int err; struct hash_data hdata; - int digest_size; LTC_ARGCHK(in != NULL); LTC_ARGCHK(out != NULL); @@ -40,9 +39,8 @@ int hash_memory(const struct algo_properties_st *hash, const unsigned char *in, return err; } - digest_size = _ncr_algo_digest_size(hash->algo); - if (*outlen < digest_size) { - *outlen = digest_size; + if (*outlen < hash->digest_size) { + *outlen = hash->digest_size; return CRYPT_BUFFER_OVERFLOW; } @@ -59,7 +57,7 @@ int hash_memory(const struct algo_properties_st *hash, const unsigned char *in, err = cryptodev_hash_final(&hdata, out); - *outlen = digest_size; + *outlen = hash->digest_size; LBL_ERR: cryptodev_hash_deinit(&hdata); diff --git a/libtomcrypt/hashes/hash_memory_multi.c b/libtomcrypt/hashes/hash_memory_multi.c index 79cfd2b..a10e14c 100644 --- a/libtomcrypt/hashes/hash_memory_multi.c +++ b/libtomcrypt/hashes/hash_memory_multi.c @@ -32,7 +32,6 @@ int hash_memory_multi(const struct algo_properties_st *hash, unsigned char *out, const unsigned char *in, unsigned long inlen, ...) { struct hash_data hdata; - int digest_size; int err; va_list args; const unsigned char *curptr; @@ -46,9 +45,8 @@ int hash_memory_multi(const struct algo_properties_st *hash, unsigned char *out, return err; } - digest_size = _ncr_algo_digest_size(hash->algo); - if (*outlen < digest_size) { - *outlen = digest_size; + if (*outlen < hash->digest_size) { + *outlen = hash->digest_size; return CRYPT_BUFFER_OVERFLOW; } @@ -77,7 +75,7 @@ int hash_memory_multi(const struct algo_properties_st *hash, unsigned char *out, err = cryptodev_hash_final(&hdata, out); - *outlen = digest_size; + *outlen = hash->digest_size; LBL_ERR: cryptodev_hash_deinit(&hdata); va_end(args); |
