Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1644729ybl; Wed, 14 Aug 2019 21:54:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxugQd2Y2A9DgRwE6cZG6s5SY4i9EzeXbXhPTOBw3hpniUtijGRhvasYw4RBqepdXFlmRwA X-Received: by 2002:a63:3148:: with SMTP id x69mr1995029pgx.300.1565844898300; Wed, 14 Aug 2019 21:54:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565844898; cv=none; d=google.com; s=arc-20160816; b=ikojk31Csw3fioZq7rsxppT6xSw4NlzUN/DIDi6QO5EQPO7dUW49KMkuB4uv3ACAXO mftvpIqfHMfS7xaD7KX8J+YomyKSA8rqzWkeGt+DMnhuZ54QnAU6KgJIFltV2Iy70IoP MqSc7ZT4TJhQM7Z5hH/rUGx1mtcO41PTIRvQRKkxt/CG5SpYgMKpI/xpNz7KIjX8kCs8 PFwARw5KLGcU18HoRtikPHZNGc1SNu6wdp995v/qozYyZkiXlIsAJB0vog1Ikw0tURhn w9/COBAUY2/WB/DHsRbd2UkL+ph3+y8i6ZJAISOvPYlXrIbsUo1qSTFbPn9Yho0Z2AEI H5oA== 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; bh=yVNDX4/OH9c6MpX3L19c6i4NTjuC7hOBzpW68+miJbA=; b=l5w1uwAx27Lh3f4evWg/VxqDZAjvLUmE4ya7ghPjGdFviuQ0a4frv5s/pL0SW4E7Xe OpFSiBk/20oUZCYK7qIe3mXn2QQqo580J+kSMRec6bho028DYvDzr0zQ4h1t+LxcQibX vhRKu+acxPCxId7Y/RXmz6YH29poq/wwRpWqx8eI8dIiDwD25dVlz6FyRmxEFOjuU+Zr /wpxH2jp+TM/xcYN+xjVOWy8hK7Q+sTl9WkjvIMolBotuFWPhifogkiR+iqdxBp0zylp SMuOPyMxBuZeq28s961benqbX02trPU0hJll9K3g6KkcHS9W6FBHlV/zAQaoh7niPeYs 2QOw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7si1259561plr.27.2019.08.14.21.54.35; Wed, 14 Aug 2019 21:54:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726193AbfHOEy0 (ORCPT + 99 others); Thu, 15 Aug 2019 00:54:26 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:57012 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbfHOEy0 (ORCPT ); Thu, 15 Aug 2019 00:54:26 -0400 Received: from gondolin.me.apana.org.au ([192.168.0.6] helo=gondolin.hengli.com.au) by fornost.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hy7mJ-0004v7-SW; Thu, 15 Aug 2019 14:54:23 +1000 Received: from herbert by gondolin.hengli.com.au with local (Exim 4.80) (envelope-from ) id 1hy7mH-0006S4-J2; Thu, 15 Aug 2019 14:54:21 +1000 Date: Thu, 15 Aug 2019 14:54:21 +1000 From: Herbert Xu To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, ebiggers@kernel.org, horia.geanta@nxp.com Subject: Re: [PATCH v4 06/30] crypto: caam/des - switch to new verification routines Message-ID: <20190815045421.GA24765@gondor.apana.org.au> References: <20190805170037.31330-1-ard.biesheuvel@linaro.org> <20190805170037.31330-7-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190805170037.31330-7-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt