archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <>
To: Gilad Ben-Yossef <>
Cc: Herbert Xu <>,
	"David S. Miller" <>,
	Ofir Drang <>,
	Linux Crypto Mailing List <>,
	Linux kernel mailing list <>
Subject: Re: [PATCH 1/2] crypto: testmgr - use generic algs making test vecs
Date: Wed, 26 Feb 2020 14:17:42 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Wed, Feb 26, 2020 at 04:42:45PM +0200, Gilad Ben-Yossef wrote:
> The impetus to write this patch came from my experience debugging a
> test failure with the ccree driver.
> At some point while tweaking around I got into a situation where the
> test was succeeding (that is, declaring the message inauthentic) not
> because the mutation was being detected but because the generation of
> the origin was producing a bogus ICV.

That's being fixed by your patch 2/2 though, right?

> At that point it seemed to me that it would be safer to "isolate" the
> original AEAD messages generation from the code that was being teste.
> > We could also just move test_aead_inauthentic_inputs() to below
> > test_aead_vs_generic_impl() so that it runs last.
> This would probably be better, although I think that this stage also
> generates inauthentic messages from time to time, no?

That's correct, but in test_aead_vs_generic_impl() the generic implementation is
used to generate the test vectors.

> At any rate, I don't have strong feelings about it either way. I defer
> to your judgment whether it is worth it to add a fallback to use the
> same implementation and fix what needs fixing or drop the patch
> altogether if you think this isn't worth the trouble - just let me
> know.

I just want to avoid adding complexity that isn't worthwhile.
Beyond your patch 2, how about we just do:

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 79b431545249a9..2ab48d4d317250 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -2564,11 +2564,11 @@ static int test_aead_extra(const char *driver,
 		goto out;
-	err = test_aead_inauthentic_inputs(ctx);
+	err = test_aead_vs_generic_impl(ctx);
 	if (err)
 		goto out;
-	err = test_aead_vs_generic_impl(ctx);
+	err = test_aead_inauthentic_inputs(ctx);

Then the dedicated tests for inauthentic inputs wouldn't be run until the fuzz
tests vs. generic have already passed.

- Eric

  reply	other threads:[~2020-02-26 22:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25 15:48 [PATCH 0/2] crypto: testmgr - AEAD extra tests fixes Gilad Ben-Yossef
2020-02-25 15:48 ` [PATCH 1/2] crypto: testmgr - use generic algs making test vecs Gilad Ben-Yossef
2020-02-25 19:45   ` Eric Biggers
2020-02-26  2:32     ` Eric Biggers
2020-02-26 14:42     ` Gilad Ben-Yossef
2020-02-26 22:17       ` Eric Biggers [this message]
2020-02-25 15:48 ` [PATCH 2/2] crypto: testmgr - sync both RFC4106 IV copies Gilad Ben-Yossef
2020-02-25 20:02   ` Eric Biggers
2020-02-26 15:09     ` Gilad Ben-Yossef

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* 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).