From: Steffen Klassert <steffen.klassert@secunet.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David Miller <davem@davemloft.net>, linux-crypto@vger.kernel.org
Subject: [RFC] [PATCH 4/5] authenc: Check if the IV is already added to the scatterlist
Date: Mon, 8 Jun 2009 09:11:43 +0200 [thread overview]
Message-ID: <20090608071143.GV20366@secunet.com> (raw)
In-Reply-To: <20090608070749.GR20366@secunet.com>
aead eseqiv needs to add the IV to the scatterlist itself.
So check if the IV is already contained in the scatterlist
and add it just if it is not already there.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
crypto/authenc.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/crypto/authenc.c b/crypto/authenc.c
index 5793b64..e11029a 100644
--- a/crypto/authenc.c
+++ b/crypto/authenc.c
@@ -157,15 +157,16 @@ static int crypto_authenc_genicv(struct aead_request *req, u8 *iv,
dstp = sg_page(dst);
vdst = PageHighMem(dstp) ? NULL : page_address(dstp) + dst->offset;
+ cryptlen = req->cryptlen;
- if (ivsize) {
+ if (ivsize && !(aead_request_flags(req) & CRYPTO_TFM_REQ_SG_HAS_IV)) {
sg_init_table(cipher, 2);
sg_set_buf(cipher, iv, ivsize);
authenc_chain(cipher, dst, vdst == iv + ivsize);
dst = cipher;
+ cryptlen += ivsize;
}
- cryptlen = req->cryptlen + ivsize;
hash = crypto_authenc_hash(req, flags, dst, cryptlen);
if (IS_ERR(hash))
return PTR_ERR(hash);
--
1.5.4.2
next prev parent reply other threads:[~2009-06-08 7:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-08 7:07 [RFC] [PATCH 0/5] Parallel IPsec v4 Steffen Klassert
2009-06-08 7:08 ` [RFC] [PATCH 1/5] padata: generic interface for parallel processing Steffen Klassert
2009-06-08 7:10 ` [RFC] [PATCH 2/5] pcrypt: Add pcrypt crypto parallelization wrapper Steffen Klassert
2009-06-19 12:21 ` Herbert Xu
2009-06-23 6:21 ` Steffen Klassert
2009-06-19 12:29 ` Herbert Xu
2009-06-23 8:29 ` Steffen Klassert
2009-06-23 8:34 ` Herbert Xu
2009-06-23 9:14 ` Steffen Klassert
2009-06-23 9:18 ` Herbert Xu
2009-06-23 10:19 ` Steffen Klassert
2009-06-23 10:19 ` Herbert Xu
2009-06-08 7:10 ` [RFC] [PATCH 3/5] eseqiv: Add support for aead algorithms Steffen Klassert
2009-06-25 10:46 ` Herbert Xu
2009-06-29 11:12 ` Steffen Klassert
2009-06-08 7:11 ` Steffen Klassert [this message]
2009-06-08 7:12 ` [RFC] [PATCH 5/5] tcrypt: Test algorithms by name Steffen Klassert
2009-06-19 10:53 ` Herbert Xu
2009-06-19 10:56 ` Herbert Xu
2009-06-19 11:40 ` [PATCH] " Steffen Klassert
2009-06-19 11:47 ` Herbert Xu
2009-06-19 12:38 ` Herbert Xu
2009-06-23 6:04 ` Steffen Klassert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090608071143.GV20366@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.