Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp345442ybf; Wed, 26 Feb 2020 14:19:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxUiwp27Enq1MPNBR7sAHa/qLFHytp5Nv4bclrwWw9Nc2P+KqkI6gjjNnX+nzz9NQECUuMX X-Received: by 2002:a05:6830:13d9:: with SMTP id e25mr840062otq.134.1582755550719; Wed, 26 Feb 2020 14:19:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582755550; cv=none; d=google.com; s=arc-20160816; b=xfNr4Rrg3E7FhQ2e4VyfI7HMZk5al9KHax0no79yRZ4Qo/1NZjXdTjFc+Oj9ka75/h 4/wpWVhLfS76HswHcTV+BUDoarFVKT49ZBVbJJoc1VFEOWkRg2aLnNBX/zsFkAJ1WHH6 n9Wl089KtOD+HHFgP1lThHuPL6qUQWxnx08zg4pSXx8/63EfoTqAI/382iM/KgQtKLqy jt4vIzTnLc/4KUiINgW+C3QYghp4lSmy8Fj1fRyk0aDHS3CREiuS47QstlChSYCm+jBW GDVuvKJWgv6ESraisvTzasj/smAUjMhXV0gf2Ya5ye4CjaNsCpcYQRRpjeZWehgvUqB+ grAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tPusXyHKslPHt2U5IAGQMRcTkjCqxlYSxcNvAJIL09c=; b=ttTefZaBAC9okjp3+VqYhtK72QlmVkUoskUrZ9/Bxfxn3cs8d8PyFUW9Zd1xMUUOaV 0BmrhlxyNnH0ZPJIUKPqMp/KXRnHmU/2I93Zn7VjgNNBrEZaS7MsxjrV13ZEGajFQhtF tJi8AK3I9k9QWmE7g2lE9U8S+60g6k+X6FfkaHff3q7954B5Dm/rib9dB8ElWz6TVKXE V9R+Qkm7nqWQgNs6YmLWtkLIorKs6fAyMcb0k1hKHOMxisMJOvk52WjZreWifBubga/b R2h2aR1FxXKJrhAFRvsFUb0q1nmiqEjtoCVG+v8AfjQEFbfVquCDkDK7IrBYm6uyS2fq kM7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DAebMMvi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a12si275527oie.87.2020.02.26.14.18.58; Wed, 26 Feb 2020 14:19:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DAebMMvi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727832AbgBZWRo (ORCPT + 99 others); Wed, 26 Feb 2020 17:17:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:34802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727715AbgBZWRo (ORCPT ); Wed, 26 Feb 2020 17:17:44 -0500 Received: from gmail.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC7702072D; Wed, 26 Feb 2020 22:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582755463; bh=cs+KD5MTlL+9h4Tj3lAJWI9MH0tgnD0DmNQnuZrw/9c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DAebMMviU1D71LPXnPss901gxpWeddvg5oFWeaWscNgSXKScZnKkl2Dw9x39ynyOG QmpkTRir9i88Bu7uB45IQ0SkYdFKHAzxqgQy4R6/Mi0MFma4i1a/cj2K591KSfyOgG mCSzF8p+g5KzQHhHWKmt7G6rV/26BKVg8kbF6Tk8= Date: Wed, 26 Feb 2020 14:17:42 -0800 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 Message-ID: <20200226221742.GA135806@gmail.com> References: <20200225154834.25108-1-gilad@benyossef.com> <20200225154834.25108-2-gilad@benyossef.com> <20200225194551.GA114977@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); out: kfree(ctx->vec.key); kfree(ctx->vec.iv); Then the dedicated tests for inauthentic inputs wouldn't be run until the fuzz tests vs. generic have already passed. - Eric