From: "Horia Geantă" <horia.geanta@freescale.com>
To: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>,
<linux-crypto@vger.kernel.org>
Cc: Herbert Xu <herbert@gondor.hengli.com.au>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 2/2] crypto: testmgr - make test_aead also test 'dst != src' code paths
Date: Tue, 12 Nov 2013 13:11:53 +0200 [thread overview]
Message-ID: <52820CF9.3070406@freescale.com> (raw)
In-Reply-To: <20120921072652.11790.31387.stgit@localhost6.localdomain6>
On 9/21/2012 10:26 AM, Jussi Kivilinna wrote:
> Currrently test_aead uses same buffer for destination and source. However
> in any places, 'dst != src' take different path than 'dst == src' case.
>
> Therefore make test_aead also run tests with destination buffer being
> different than source buffer.
>
> Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
> ---
> crypto/testmgr.c | 153 +++++++++++++++++++++++++++++++++++++-----------------
> 1 file changed, 105 insertions(+), 48 deletions(-)
>
> diff --git a/crypto/testmgr.c b/crypto/testmgr.c
> index 00f54d5..941d75c 100644
> --- a/crypto/testmgr.c
> +++ b/crypto/testmgr.c
> @@ -442,18 +460,26 @@ static int test_aead(struct crypto_aead *tfm, int enc,
> authsize = abs(template[i].rlen - template[i].ilen);
> ret = crypto_aead_setauthsize(tfm, authsize);
> if (ret) {
> - printk(KERN_ERR "alg: aead: Failed to set "
> - "authsize to %u on test %d for %s\n",
> - authsize, j, algo);
> + pr_err("alg: aead%s: Failed to set authsize to %u on test %d for %s\n",
> + d, authsize, j, algo);
> goto out;
> }
>
> sg_init_one(&sg[0], input,
> template[i].ilen + (enc ? authsize : 0));
>
> + if (diff_dst) {
> + output = xoutbuf[0];
> + sg_init_one(&sgout[0], output,
> + template[i].ilen +
> + (enc ? authsize : 0));
> + } else {
> + output = input;
> + }
In case of diff_dst (src != dst), is there any assumption / convention
regarding allocation length of req->src and req->dst - are they supposed
be equal, even if it's not needed?
For example, in case of diff_dst && encryption, currently both req->src
and req->dst have then length = template[i].ilen + authsize. Shouldn't
length of req->src be template[i].ilen, i.e. no space allocated for ICV?
Thanks,
Horia
next prev parent reply other threads:[~2013-11-12 11:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-21 7:26 [PATCH 1/2] crypto: testmgr - make test_skcipher also test 'dst != src' code paths Jussi Kivilinna
2012-09-21 7:26 ` [PATCH 2/2] crypto: testmgr - make test_aead " Jussi Kivilinna
2012-09-21 16:11 ` David Miller
2012-09-27 5:45 ` Herbert Xu
2013-11-12 11:11 ` Horia Geantă [this message]
2013-11-12 21:54 ` Jussi Kivilinna
2013-11-28 13:11 ` [PATCH 1/4] crypto: ccm - Fix handling of zero plaintext when computing mac Horia Geanta
2013-11-28 13:11 ` [PATCH 2/4] crypto: caam - fix aead sglen for case 'dst != src' Horia Geanta
2013-11-28 13:11 ` [PATCH 3/4] crypto: talitos " Horia Geanta
2013-11-28 13:11 ` [PATCH 4/4] crypto: testmgr - fix sglen in test_aead " Horia Geanta
2013-11-28 14:26 ` [PATCH 1/4] crypto: ccm - Fix handling of zero plaintext when computing mac Herbert Xu
2012-09-21 16:11 ` [PATCH 1/2] crypto: testmgr - make test_skcipher also test 'dst != src' code paths David Miller
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=52820CF9.3070406@freescale.com \
--to=horia.geanta@freescale.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.hengli.com.au \
--cc=jussi.kivilinna@mbnet.fi \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).