Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3906374pxf; Tue, 6 Apr 2021 03:21:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwhjhtFTCeBi2k+saMHVVrG/ohB/QBXrT4inphks17Uj1Lo7Z8YcIH7YC2feH/RnBqThHb X-Received: by 2002:a17:906:5618:: with SMTP id f24mr575000ejq.414.1617704460567; Tue, 06 Apr 2021 03:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617704460; cv=none; d=google.com; s=arc-20160816; b=RFJGfKcpwK+nDoGKvd9zYhdUzRDbTcer3CXAlaprO02doGNBonR1h1G9e8GY/SreG7 SYKioWMiyJPoHIKroJzr3yRaVxibVZMcyhTscUyeIQmDT6OTB6iFs8LyutEu9nNgYiPU c1BvbtlDRAKG6L2G621jpZi1Go0b0huCkXp0OIZPpbU2Di1QfVa87AxAg+qJtim++zpT FAA8ZlRtkqZMEWGQpFPhq8xg7+cyzgyYR52mdI2HAyeQWQAuQuWFZ9uJ6F0XVtP4oDHm 9lkUiabblSe7vlCKZ2anrjaI2zy81fXSpFzkSwlGoZ/NlcdGqsv5OACXzpnJoqrpvNPy ol0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yjPJwTgEEcZdNSuKzyQlQgPz3fsRy1o33yFNzxrrfac=; b=KIeElumOb/5D2JjS7+3iNYYCay/MHRMwY0cRKdH9MY/Pu3dt90rkKqttcWED4LL/hC qNdcsuujZGy0tqUR/a8jdyNJW2vAu9vXu48BaxxI78RUqO/sS9jPW5roClmYzAKg0y0K VSQ8PFqqzeZp0ppCh0Urt8mMsHILTNO5BezPRejd031lNApW252Mkm081LbsFjSCh5Lu qbCq2J+JyRojzgr2EKssooNKGMwHrVE0EhKzmBGe5LP1GgIsOmI5yywsWg0uLNi4Ve55 EvtWYzDslmvtgOJMVom9jZwSfDQDz8/NkJgkELWP/NpW0bpeCeVGp+0Dcpxa/4w8AwE/ MHLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="xAXIV4X/"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id g17si2201624edy.301.2021.04.06.03.20.37; Tue, 06 Apr 2021 03:21:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="xAXIV4X/"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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 S236074AbhDEWc6 (ORCPT + 99 others); Mon, 5 Apr 2021 18:32:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232835AbhDEWc5 (ORCPT ); Mon, 5 Apr 2021 18:32:57 -0400 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C137C061756 for ; Mon, 5 Apr 2021 15:32:50 -0700 (PDT) Received: by mail-ot1-x32f.google.com with SMTP id 68-20020a9d0f4a0000b02901b663e6258dso12736285ott.13 for ; Mon, 05 Apr 2021 15:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=yjPJwTgEEcZdNSuKzyQlQgPz3fsRy1o33yFNzxrrfac=; b=xAXIV4X/g6BfggIfAFOUMGYh4Qis6ID9Rp+nCu/5HpbbtRmk6sgPyzhuH4imjBuSuc fkAoiT0P5ZaihDOaUgy8Us/d+uAMpOK4jdAmqB2Z60vp6DcHXNtN5CjXKR6SCbXdUzpB wurVZZTQpQRh0/laCKet/OfkyPE/OLoYGkRlq6YYKnckWX8e55KmI6svRADScEezsa6U PJOzu214E5nYo4x13XzJfhBaDzFGPm/TwUKxX101NWVuwyCpLaJ+5t475irN19ApFsx3 usqcx8L95XSar3XRjpLBWl+4Ugbm2eL46ndGRWW4TjTmSevdo5Ow/5+1MBkw5Re60gj0 hu6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yjPJwTgEEcZdNSuKzyQlQgPz3fsRy1o33yFNzxrrfac=; b=MDSFEXkhJPoDZq83cTklJBa3Xf/qJclNjHjUpCxhNfgrqKuwnElFrqvYL0sIrOcQZx Z1ukj1r/6DqdxLtRZOrQnmaI3ILrQaEQA8WcOVn9sptxtNOVgBI2FENnlPbOGjJV22FX VY8gGmHjWH2w1OW8Nwdrsw9RZcZoXaht2lxIS6MMul8RpmYXxBnOzrd6k13Gsp+Hoqtf aXBltlZMT96Hu8e0+OaQE22BxITF2w9bUsCkc1ATmqbt34FVGeIJyuUGkoJLdzm6cChd R48Lyl3atzovgirUgirVCV7IF25cC75I9MS8eKrcAlpDu+UO1mgQuZYGlSsHh8Y0In03 95GA== X-Gm-Message-State: AOAM530CxwYb0gOLqqJaT4UKbBFjOOBQ7wx43pXj4INRgGQgsKPz2sJW y/o33ARLCXqZ5MFdT6WW7ikJMXZKmOGZbA== X-Received: by 2002:a05:6830:2248:: with SMTP id t8mr23660323otd.211.1617661970066; Mon, 05 Apr 2021 15:32:50 -0700 (PDT) Received: from yoga (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id z14sm3293523oid.12.2021.04.05.15.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Apr 2021 15:32:49 -0700 (PDT) Date: Mon, 5 Apr 2021 17:32:47 -0500 From: Bjorn Andersson To: Thara Gopinath Cc: herbert@gondor.apana.org.au, davem@davemloft.net, ebiggers@google.com, ardb@kernel.org, sivaprak@codeaurora.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/7] crypto: qce: Add mode for rfc4309 Message-ID: <20210405223247.GC904837@yoga> References: <20210225182716.1402449-1-thara.gopinath@linaro.org> <20210225182716.1402449-4-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210225182716.1402449-4-thara.gopinath@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu 25 Feb 12:27 CST 2021, Thara Gopinath wrote: > rf4309 is the specification that uses aes ccm algorithms with IPsec > security packets. Add a submode to identify rfc4309 ccm(aes) algorithm > in the crypto driver. > > Signed-off-by: Thara Gopinath > --- > drivers/crypto/qce/common.h | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/crypto/qce/common.h b/drivers/crypto/qce/common.h > index 3bc244bcca2d..3ffe719b79e4 100644 > --- a/drivers/crypto/qce/common.h > +++ b/drivers/crypto/qce/common.h > @@ -51,9 +51,11 @@ > #define QCE_MODE_CCM BIT(12) > #define QCE_MODE_MASK GENMASK(12, 8) > > +#define QCE_MODE_CCM_RFC4309 BIT(13) > + > /* cipher encryption/decryption operations */ > -#define QCE_ENCRYPT BIT(13) > -#define QCE_DECRYPT BIT(14) > +#define QCE_ENCRYPT BIT(14) > +#define QCE_DECRYPT BIT(15) Can't we move these further up, so that next time we want to add something it doesn't require that we also move the ENC/DEC bits? > > #define IS_DES(flags) (flags & QCE_ALG_DES) > #define IS_3DES(flags) (flags & QCE_ALG_3DES) > @@ -73,6 +75,7 @@ > #define IS_CTR(mode) (mode & QCE_MODE_CTR) > #define IS_XTS(mode) (mode & QCE_MODE_XTS) > #define IS_CCM(mode) (mode & QCE_MODE_CCM) > +#define IS_CCM_RFC4309(mode) ((mode) & QCE_MODE_CCM_RFC4309) While leaving room for the typical macro issues, none of the other macros wrap the argument in parenthesis. Please follow the style of the driver, and perhaps follow up with a cleanup patch that just wraps them all in parenthesis? Regards, Bjorn > > #define IS_ENCRYPT(dir) (dir & QCE_ENCRYPT) > #define IS_DECRYPT(dir) (dir & QCE_DECRYPT) > -- > 2.25.1 >