diff options
-rw-r--r-- | cryptodev_cipher.c | 7 | ||||
-rw-r--r-- | libtomcrypt/hashes/hash_memory.c | 6 | ||||
-rw-r--r-- | libtomcrypt/hashes/hash_memory_multi.c | 6 | ||||
-rw-r--r-- | ncr-sessions.c | 12 |
4 files changed, 7 insertions, 24 deletions
diff --git a/cryptodev_cipher.c b/cryptodev_cipher.c index 0446a5d..05e6db3 100644 --- a/cryptodev_cipher.c +++ b/cryptodev_cipher.c @@ -258,6 +258,13 @@ int ret; ahash_request_set_callback(hdata->async.request, CRYPTO_TFM_REQ_MAY_BACKLOG, cryptodev_complete, hdata->async.result); + ret = crypto_ahash_init(hdata->async.request); + if (unlikely(ret)) { + dprintk(0,KERN_ERR, + "error in crypto_hash_init()\n"); + goto error; + } + hdata->init = 1; return 0; diff --git a/libtomcrypt/hashes/hash_memory.c b/libtomcrypt/hashes/hash_memory.c index 7c0aa4e..274c208 100644 --- a/libtomcrypt/hashes/hash_memory.c +++ b/libtomcrypt/hashes/hash_memory.c @@ -52,12 +52,6 @@ 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 52e8076..6a85f65 100644 --- a/libtomcrypt/hashes/hash_memory_multi.c +++ b/libtomcrypt/hashes/hash_memory_multi.c @@ -58,12 +58,6 @@ 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; diff --git a/ncr-sessions.c b/ncr-sessions.c index c177a65..d8a9b4f 100644 --- a/ncr-sessions.c +++ b/ncr-sessions.c @@ -416,12 +416,6 @@ static int _ncr_session_init(struct ncr_lists* lists, struct ncr_session_st* ses goto fail; } - ret = cryptodev_hash_reset(&ns->hash); - if (ret < 0) { - err(); - goto fail; - } - break; case NCR_OP_DIGEST: if (algo_can_digest(session->algorithm)==0) { @@ -442,13 +436,7 @@ static int _ncr_session_init(struct ncr_lists* lists, struct ncr_session_st* ses goto fail; } - ret = cryptodev_hash_reset(&ns->hash); - if (ret < 0) { - err(); - goto fail; - } break; - default: err(); ret = -EINVAL; |