summaryrefslogtreecommitdiff
path: root/crypto/ccm.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ccm.c')
-rw-r--r--crypto/ccm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/crypto/ccm.c b/crypto/ccm.c
index 1df8421..499c917 100644
--- a/crypto/ccm.c
+++ b/crypto/ccm.c
@@ -271,8 +271,7 @@ static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain,
}
/* compute plaintext into mac */
- if (cryptlen)
- get_data_to_compute(cipher, pctx, plain, cryptlen);
+ get_data_to_compute(cipher, pctx, plain, cryptlen);
out:
return err;
@@ -364,7 +363,7 @@ static void crypto_ccm_decrypt_done(struct crypto_async_request *areq,
if (!err) {
err = crypto_ccm_auth(req, req->dst, cryptlen);
- if (!err && crypto_memneq(pctx->auth_tag, pctx->odata, authsize))
+ if (!err && memcmp(pctx->auth_tag, pctx->odata, authsize))
err = -EBADMSG;
}
aead_request_complete(req, err);
@@ -423,7 +422,7 @@ static int crypto_ccm_decrypt(struct aead_request *req)
return err;
/* verify */
- if (crypto_memneq(authtag, odata, authsize))
+ if (memcmp(authtag, odata, authsize))
return -EBADMSG;
return err;