Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3010797pxb; Tue, 13 Apr 2021 16:20:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwG47Zm0Jowixr7OpWk2PMCDwYqHx8YMOBzDGz8UoyG+hrbMcKtI4qEX2RJA9q6XNu7dWjv X-Received: by 2002:a17:906:2818:: with SMTP id r24mr34616584ejc.502.1618356042865; Tue, 13 Apr 2021 16:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618356042; cv=none; d=google.com; s=arc-20160816; b=lUwUyTey0k9L3mVWZV941/WDLJqYCBH4FUI5CFTiwZ1wfOsCNVqPAj9tsgxywEu93P Ls62mJzvjzxG/zeqzaUHMcAi6uSGCJAmgcbZNp/H5QvXIjQ4D7BRaNuTlYwkqyBGLta/ HBdCGV1anUQ0MFOBSUvj64xpCUhM09g646a5N9L4AXay9EsJdBmrCeT+dTjyh2JIBns8 cDX6wK0Z+mPGO+GEiUPuRHRzCRh+1rkvEH5O7asRcB0ZXJTKA6Hm7PvCukanDm7Y/FrQ uI1rV1thJSCXjKBG/YYRnqeznA8Zn4s916gG4WR00tByMEs3u27uJYXxYM8Nqt4JkOBR U/wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=PVwoQvaJMxO+yP07DhbysT5h5ccAWpMl0VED6nG2Vg0=; b=OPE6NIP7q3iJnetTnpeLnnNnJqn19O6/5kDORq0OPsrGH3gYdaj0FVKagWUjf83qgY S5PxUoLtADBPoeXCniWRBN/UAytcqgZSzjFKt7ys57HicaHpSRb/NCC8gLPpDVvAknsy IjBnYDPIQasOe/eQvupgjKd4WVR9Kaycm2vOEGl4TA0ARRH92DIPviSCRlJu9ki0qIcE iMuDidQq0FtpJfbXdrAGIEUEaMjZz4oWW04H4o+hpOxA0eYUhRSbx6tJk6rZ3mCkB8/2 CkfPJl5OA+/XKQ2zU+zVyfm/EnX18jXLAKkKHahDxUxH+gjqwZmnK1ulIKqsuveGZSRn 0seg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CluRNLj9; 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 f4si11350054eja.638.2021.04.13.16.20.19; Tue, 13 Apr 2021 16:20:42 -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=CluRNLj9; 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 S238057AbhDMTa2 (ORCPT + 99 others); Tue, 13 Apr 2021 15:30:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbhDMTa1 (ORCPT ); Tue, 13 Apr 2021 15:30:27 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B96E5C061574 for ; Tue, 13 Apr 2021 12:30:07 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id m16so13010651qtx.9 for ; Tue, 13 Apr 2021 12:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=PVwoQvaJMxO+yP07DhbysT5h5ccAWpMl0VED6nG2Vg0=; b=CluRNLj9fbx1ugBM+N2UuM5PObwNeOIlaq1OfkyrXK+H3bNheYPoAPiT8SCAFj7DM1 +whx+6Kgc+RlG2Hh/7tmPxBxZuWizsP9YXTt5XJurMtBjnK237cktUo3SoruhUPTle6R TDgd0tifyPROWrB7tvDr8RG+/XeNbVKLRzpRGDVAf69N4dfoK71Zg9p1Cqj9WxEXhepd 9zqff+/PUvN3ekkHJwOGnTHCwdgYJ5M7UngCTRZos0kARvDVr9ZlFurOOzimpsO2zhzW D1a41Mmkjf7jTlaMGC8XORvzx+VHv6nZ0dngfU6ISD0q1cPABCfjKPcrMBwkJ69Jf108 zheA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PVwoQvaJMxO+yP07DhbysT5h5ccAWpMl0VED6nG2Vg0=; b=QXF14s+2m9GBpRCaQAsZwVKqcDaPz5xDenTuA/NaEil/zrE7YHzQuWDpRQADRpCESM V+TpSTxX86I8gmo5ffYvDmi/B88mOhlkDWAnIpq1j+mOkwAgGvrPosOquivxJ8H2dWxQ dMoCBx/6g+UTJuxGDG99A7pdP/+6Roqp8ekeHk8K4btcL6Wy8xKWmg3Pf2h5BEx2lEUr IstJ5r8hX9ZwoTIY6w4SDEdtOgJ8qwdGsor1bIFPfwYlcLBUmKnbz5e1X7o6UPStGPdA svOeNLCWcDlDf0eVYNTrPb4JWDf18WWCOGKmuGIn4+QNUnL4ieYgJQtuIZ5UgaAW9/5s C9Ig== X-Gm-Message-State: AOAM531U3SrR4DUVWRX8U2YOesB4u2EEkHX/ELz8ukB8z43wl846QGVU twRC2be9l6EW0573kTsqHKU8Dw== X-Received: by 2002:ac8:7a77:: with SMTP id w23mr15765350qtt.277.1618342206911; Tue, 13 Apr 2021 12:30:06 -0700 (PDT) Received: from [192.168.1.93] (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.gmail.com with ESMTPSA id l124sm182499qkf.38.2021.04.13.12.30.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Apr 2021 12:30:06 -0700 (PDT) Subject: Re: [PATCH 3/7] crypto: qce: Add mode for rfc4309 To: Bjorn Andersson 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 References: <20210225182716.1402449-1-thara.gopinath@linaro.org> <20210225182716.1402449-4-thara.gopinath@linaro.org> <20210405223247.GC904837@yoga> From: Thara Gopinath Message-ID: <39683997-42ad-bd91-0c31-a9e982e0ba61@linaro.org> Date: Tue, 13 Apr 2021 15:30:05 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210405223247.GC904837@yoga> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 4/5/21 6:32 PM, Bjorn Andersson wrote: > 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? Yes I will change it to BIT(30) and BIT(31) > >> >> #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? This does throw up a checkpatch warning if I don't wrap "mode" in parenthesis. How about I keep this for now and I will follow up with a clean up for rest of the macros later ? > > Regards, > Bjorn > >> >> #define IS_ENCRYPT(dir) (dir & QCE_ENCRYPT) >> #define IS_DECRYPT(dir) (dir & QCE_DECRYPT) >> -- >> 2.25.1 >> -- Warm Regards Thara