Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2992916pxb; Mon, 19 Apr 2021 20:36:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXLb3WGotrq0jcbq9qm23Lfllv4viI+KWkqcvUn/3AhNbej36iRz3j5CoDkKXg0ih4C8VK X-Received: by 2002:a17:902:8641:b029:e4:7e05:c916 with SMTP id y1-20020a1709028641b02900e47e05c916mr25701428plt.57.1618889797173; Mon, 19 Apr 2021 20:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618889797; cv=none; d=google.com; s=arc-20160816; b=yCtJCB62o0yLTODkxx98wRo8VuUFaQTH/KnsW2sJXkdIVO41ekgD9cZH+DXFGP/e5w cG/OT2haJIIlTOe5RNgLDj283hGqGIBItHrOj6D5rUoJrL9QLMvNRj4AknFK0xmjVuKT 38F6ak9G8u6m1MVWfzHsNQodj6uT3ruZ2ZAKOIq9eY18d5FWULHiiD+5ZMlsEiDJh7HD YNu8adQmrWNI5vjR5D/2iI50E9M4annSt1t7y3Wb4Vbmi9buPL2YaaTyuki8BH5bbza2 /wEWe+S+RkcfWWrE1Agn+R4I8pUCRwnRTxaLQWK80BV8g7dVUPVtGoJ2se5ecy0u4rdZ yEug== 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=qMlAzReAsQJYfKeoM1IaQXEFR/zkcSrXAl7cvK+kIZl+c+tkntkAqmaNwXAbCZF6oU ZwrG1Y6t6Dg0MGjKVzxNIcH7jgh/9w0kLbHZyynemkg8cQkmVugNG/NhsAPJQtJ5D6eD b0nrGTdmViZfb7rMisZsZGuAwFlM5oqW+BuT8uujnOt1RLUiu8j3QAhRBNvhGZWHEyCX ggTAl1INAZ3u2x03dyE8F1gZbUyVZnD+b85veioj41tdUsR3u/6QXcq6af2MmPFXG40q HhbaRahQ5gzBRcrIcS3OgyEKnjspJeyhWlypiZPs0aa+bGJ20yQgpzcXcHEbaHZ98xce w79w== 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-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 130si19438771pga.231.2021.04.19.20.36.22; Mon, 19 Apr 2021 20:36:37 -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=BmeAmUO+; 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 S233670AbhDTDgl (ORCPT + 99 others); Mon, 19 Apr 2021 23:36:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233861AbhDTDgj (ORCPT ); Mon, 19 Apr 2021 23:36:39 -0400 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3B17C06138E for ; Mon, 19 Apr 2021 20:36:06 -0700 (PDT) Received: by mail-qv1-xf34.google.com with SMTP id h3so17199342qve.13 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=l3LnWkMI74Rlsk606IyguttaOl9xORwQCYsAzXnQCyZrmVM3sAP0X8yyXJ+Sdh+00R FV2iSiWZwy6eMQbLodxtj8oYkG+WN0/HkfeORVLJEuK2bvvvS99XAguKJ6j3RH5EmzU9 jdRrTYo6Yu8X7+U1S9D5Zs9QeXxOD3tLihREkUUJJQx4t1NQ50O4WCPydZJ5F31Ih/j0 pJbgcYWxFDyA3joFDoHMm0J4Ckg0NRjMhDwplIlmhpN0vhmQnGEgWNM2+cnDOwq6ROHJ dWpbBDJBxEqExpDWyGGVIrCY+voeC+WrrQAKLEe/Lgn7m46h9/NdAbzHcs9GOQIN70P6 E7aA== X-Gm-Message-State: AOAM533JHHNjR7Ml0bPUuelchqUbAZfDmryuGEbUnBjzgdAOPkihLJUB bmppNKw5io1MbcS1QJWkkE1wAg== 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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(-) 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) -- 2.25.1