Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1682198ybl; Wed, 14 Aug 2019 22:45:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQomvsF9a85xLcC0sPywNU+EwHKFOChd0QnU5XLlOvf+jyejFkwA+frwGXRcyP92VraD59 X-Received: by 2002:a63:181:: with SMTP id 123mr2311894pgb.63.1565847935841; Wed, 14 Aug 2019 22:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565847935; cv=none; d=google.com; s=arc-20160816; b=EDNv2bXsacsGnBQFLw7okBcLxK7USTz0cJ1Kg07F2xKQUvSQof8lEWGBd0XNqoIVN4 AfP7Q3MTEv7zImWGxTsZms973khIR+YOaMbKM3oc031/ub90qdi3sx/4o9+XNlMmoffh 9yXz4vqPL6IZ8rOiPcCbzpOTB2YeVm7STwUtrPXL/3is8wTbOSiIecF3iUCtRpIDfRUv a180qvlvE5m9HHa7umsUSNck4iUSWP8xgbFUqA60NU5eEyN6OtG4lelEfrt+FrtxyaIi CbMi4yOAKb9fwipc/BsXZdOpCjxqSTRncTBBZbhTjHtiOZ5DhCuh+DoTeC9YW83hs+pT caAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QPiCDehj5KfLjTayla1DpLWE9agAsJpKBwRt66M5ZoY=; b=S0vy2EoJOYpPa/Y1YWg6tqBmxTcbpBPlRmFjT5rPr/s6ZFCzNz6kBTQlTResE3B4mv D2xV+qkmaJohKYx5lzzSaxyawuooBz6cmOuNcMv0f/pQp8YihOY5KjSUxma1ZfShf9JS NQKPp1LLfv/YXXNNTWA7qzI8HtcWHIapEoyvJoI67prW5fnoqgTzW87FxNbNA57KmlHj WwC5eNmbBPIIEiCn8qyCrFSJFO+lhs3nk8wenT01d/fM5XD5N2grVHEGeM0PNTrcynjt YPZGf5lqWmgpj0mdrUd4aNF0AnVN0wckq8npcyk8y8efKsCbjj2WjYtpF7W+MJnyjagz x/Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hNRS9bFQ; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si1346836plv.130.2019.08.14.22.45.10; Wed, 14 Aug 2019 22:45:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@linaro.org header.s=google header.b=hNRS9bFQ; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728464AbfHOFBk (ORCPT + 99 others); Thu, 15 Aug 2019 01:01:40 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38741 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbfHOFBk (ORCPT ); Thu, 15 Aug 2019 01:01:40 -0400 Received: by mail-wr1-f68.google.com with SMTP id g17so1131267wrr.5 for ; Wed, 14 Aug 2019 22:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QPiCDehj5KfLjTayla1DpLWE9agAsJpKBwRt66M5ZoY=; b=hNRS9bFQCby4PHmaG9Oh2Q9VKwn250G04rB4Ly2/uwn97d+BC352VBUZvdYiMRX9vx 0pCkD1g3i0l3mnkg+E82A636h5C/LromCdN6kJogbsWcBOV/pqpVQRnhNYxfiolKxtR0 sxfkQi4pykpsEHUFNS1Q0ycatascGy3isCWFfkHp2l8vixRMVPAeXIx5/BIf2NcLgMPj nFZlwm7ynyVxulhwDsQtygpOKaxL2JZS+XC5snkyOMCwmanfAkH6XQNv3ua/TRo94WNo IBzZr7+lpV1EuRwJDM47+/JEQRjEu9xJp2YphUXQH2OBoojq3AsdpEihrPRw/g5pnM0m h2zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QPiCDehj5KfLjTayla1DpLWE9agAsJpKBwRt66M5ZoY=; b=knbdJYg8CyjLMAe8M3gBDJikHqsuRUBWBFo7TK7PZdBxJeM3xcGSsPL+IeMnBPnpdd C6/3pEfZXWkgtXn/XWL6Bzwc6fB8eunz9o8ARtoUnP3v2/DooAMZgXMKK587G/2pbVfc lKE1Dr/pELwJFMzRiRqF37oZo25dKZKUuGfzWdxSRLg2B57UfQy36BxyjgYXrLJ66ldF jnfnSRUmKv9RXbNqeJ79fcFgsoRq0N7N3ueZ7vuXk6f8mrqaoKTMzHqOi3iCe9YO//aj 1j3B82K0hH/hNoQkKqTFWyj0j6lK0g3pvFht5tsT2AAZm+LrIS85bWcMMA2jJ1QcohkL hagg== X-Gm-Message-State: APjAAAWlEn652I9lgGmKh0BFOxoxDjeiU+2uDWU3HuctlxgayoqqOEEG KCtQyFKM05BZneAhnRf6m3bxvY0vq9Dors5l5e88gmJJbeGHnA== X-Received: by 2002:a05:6000:128d:: with SMTP id f13mr3203861wrx.241.1565845298567; Wed, 14 Aug 2019 22:01:38 -0700 (PDT) MIME-Version: 1.0 References: <20190805170037.31330-1-ard.biesheuvel@linaro.org> <20190805170037.31330-7-ard.biesheuvel@linaro.org> <20190815045421.GA24765@gondor.apana.org.au> In-Reply-To: <20190815045421.GA24765@gondor.apana.org.au> From: Ard Biesheuvel Date: Thu, 15 Aug 2019 08:01:27 +0300 Message-ID: Subject: Re: [PATCH v4 06/30] crypto: caam/des - switch to new verification routines To: Herbert Xu Cc: "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Eric Biggers , =?UTF-8?Q?Horia_Geant=C4=83?= Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, 15 Aug 2019 at 07:54, Herbert Xu wrote: > > On Mon, Aug 05, 2019 at 08:00:13PM +0300, Ard Biesheuvel wrote: > > > > @@ -644,14 +643,8 @@ static int des3_aead_setkey(struct crypto_aead *aead, const u8 *key, > > if (keys.enckeylen != DES3_EDE_KEY_SIZE) > > goto badkey; > > > > - flags = crypto_aead_get_flags(aead); > > - err = __des3_verify_key(&flags, keys.enckey); > > - if (unlikely(err)) { > > - crypto_aead_set_flags(aead, flags); > > - goto out; > > - } > > - > > - err = aead_setkey(aead, key, keylen); > > + err = crypto_des3_ede_verify_key(crypto_aead_tfm(aead), keys.enckey) ?: > > + aead_setkey(aead, key, keylen); > > Please don't use crypto_aead_tfm in new code (except in core crypto > API code). > > You should instead provide separate helpers that are type-specific. > So crypto_aead_des3_ede_verify_key or verify_aead_des3_key to be > more succinct. > OK