From patchwork Tue Apr 20 03:35:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 424544 Delivered-To: patch@linaro.org Received: by 2002:a17:906:6d12:0:0:0:0 with SMTP id m18csp3272435ejr; Mon, 19 Apr 2021 20:36:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2oyA1t3+Rlkt/WH1dKzZ5+FuUSw4mXmxg0tyqwQAaDkuC7Hfod9BM6SfVyQI34qPitQDE X-Received: by 2002:aa7:c5c2:: with SMTP id h2mr15503247eds.38.1618889779591; Mon, 19 Apr 2021 20:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618889779; cv=none; d=google.com; s=arc-20160816; b=fUWaO+1RfhaLkiZ1SJYpoBnCMV6XPcpX/9Vw8GkfitKkvrzyiVTwPQRPO4ZxOaAmhC 4FTTquNu7lCeMzs+wSf97rVQYPwlU5K/GrsCVLBv4bNxfWD+b3quqkTG+nXGqUdlYB/P eohX0afnod87R+QfWRKpPf+Ho3SVr612OdEp1g6WefSjsXh3nUYthicPtCPYsoOBg3mM Dxvil9vwBaD29zEdu6hE3bkHi9nmrtkXpNGkXDffgH/RIwClLxKO7G8xsSfKr0chZgOE LfAvDb1FRjHtE9uJbULyuLUBoI9sTAp5rfxSWc4wogYST3/C5AW/FEnwnOoR23qwWxTF IvjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7tQSQBp8E/uoMZD1l/8pHdv/Ocs7V0bwBi7hSbeXtqY=; b=fOgZQQej421MSN9HmprReaMXpSg7k8XyoyVM98KPbGSQzTEr6QyY4C5BLed6UVkrKl q+SCFTVcSxX8YnHGRorkVY6lF+2QZcTBSAV02byEckDOa65UxujGmC/Ok/op/Ei1Z+YD gMdI0Wr55Dy1in/xbmMeyhQGf253w0oNF70PrvTWl+z7DYZenHoYtRlf9LgBvQ1pVvku 1wTtYepGh616Wu818dKyvbwa4enmX15UPw6CHvas13fGE4bRS3l7oYLrNhzKu7nsILYp 9M5bdLhdG8OaIDJ/x5mTG7IosgEfh0Ck7/DuKjvcRe8Q/q9Q/oLGWOzQo4CKFQPH//rH +Oag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BmeAmUO+; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 q19si13939060ejd.250.2021.04.19.20.36.19; Mon, 19 Apr 2021 20:36:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-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=BmeAmUO+; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S233989AbhDTDgk (ORCPT + 16 others); Mon, 19 Apr 2021 23:36:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233632AbhDTDgi (ORCPT ); Mon, 19 Apr 2021 23:36:38 -0400 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4A69C06138F for ; Mon, 19 Apr 2021 20:36:06 -0700 (PDT) Received: by mail-qv1-xf35.google.com with SMTP id 30so17954114qva.9 for ; Mon, 19 Apr 2021 20:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7tQSQBp8E/uoMZD1l/8pHdv/Ocs7V0bwBi7hSbeXtqY=; b=BmeAmUO+y9Cynp9A0J6ATDoKtINwWPXTcOlBYdMJiFwwGxQ9QCgbTTkPbviJsI3FAu ksCmHJ/DGuA7exPuTP8RDeCeBRVUBD+inYD2ShU+AoXT5DERMTE2L8hTvLM+kFzD1CN0 gqy8KnLyQQseiaITVVhfDjJXAz1prImBQUrqumXgOHBqbCCSHAuNfEZWTvGIXp2TgqbE 1QC1gMZeZEXKasX9tU5gImUKjmCdn/iRa40Eae2Bk+D25bAFZahnsTqK5EfPsEG3jXNL rRyNFp091ytH03NTu4kVcs8MmdBSeGyB3rAxFlFIlqdTbi38Ud28J0ZqZLZvkcPJqifQ a1yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7tQSQBp8E/uoMZD1l/8pHdv/Ocs7V0bwBi7hSbeXtqY=; b=NuoMhAcqzyLc626jWTt+jF9s8BP/LE7FpcHjGzKqT3Ad0le/ymhGczmK10gz7Aa5TI bMUTI8AmI7Yt3ZzWcKct37Sa12YP1VuKVgphOCUq36k23OER+t+hsGtmQ3C+6KZlh3BY kG3bqcYYZn5pmkcR+QG4yyYdsJObiq6oWgzUPjdUj1IqNH7MNccyFiVLxFCKrmRAci+H Ve9BRxVOA7HnJmNvgjEdD3CLc9vHwtmpiYP1990hQnzJC/vE8c5/UHgXmRp3OHewaQTF TBLUgN7XryjKZTQ5LMQ2v+87/1wF7ReezD4NTXgJlsmTNWk6nz/0SsS6UJN97LWz4S90 kbJQ== X-Gm-Message-State: AOAM531kedtF5sP770G79/wm6DFCVAQXvceS1axkfvWaoz5VY3c5keHX +XQggYV5ureso6U46N/SK56DKw== X-Received: by 2002:a05:6214:223:: with SMTP id j3mr25055724qvt.9.1618889766110; Mon, 19 Apr 2021 20:36:06 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.googlemail.com with ESMTPSA id b8sm3562643qka.117.2021.04.19.20.36.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 20:36:05 -0700 (PDT) From: Thara Gopinath To: herbert@gondor.apana.org.au, davem@davemloft.net, bjorn.andersson@linaro.org Cc: ebiggers@google.com, ardb@kernel.org, sivaprak@codeaurora.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [Patch v3 3/7] crypto: qce: Add mode for rfc4309 Date: Mon, 19 Apr 2021 23:35:58 -0400 Message-Id: <20210420033602.1729947-4-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210420033602.1729947-1-thara.gopinath@linaro.org> References: <20210420033602.1729947-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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. Reviewed-by: Bjorn Andersson Signed-off-by: Thara Gopinath --- v1->v2: - Moved up the QCE_ENCRYPT AND QCE_DECRYPT bit positions so that addition of other algorithms in future will not affect these macros. drivers/crypto/qce/common.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/drivers/crypto/qce/common.h b/drivers/crypto/qce/common.h index 3bc244bcca2d..b135440bf72b 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(30) +#define QCE_DECRYPT 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) #define IS_ENCRYPT(dir) (dir & QCE_ENCRYPT) #define IS_DECRYPT(dir) (dir & QCE_DECRYPT)