From patchwork Sat Apr 17 13:24:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 423413 Delivered-To: patch@linaro.org Received: by 2002:a02:6a6f:0:0:0:0:0 with SMTP id m47csp1228975jaf; Sat, 17 Apr 2021 06:25:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5sPPLbKn+QEiJIEBk5vamcJz4cK1sjovFnE7pat3RWi+Okjd5y9QvkZevSbg8fy74t+iS X-Received: by 2002:a17:907:75d9:: with SMTP id jl25mr12947764ejc.420.1618665916896; Sat, 17 Apr 2021 06:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618665916; cv=none; d=google.com; s=arc-20160816; b=kTqLCy3jiubB6Y2c8s4ipsV94MVqMFy8r27VuhUfLxtzg8MlxA3XbCGRzl4PhCEdkO i1sn45zJH8Pl50uckUkla+NPzeXs0cPC2+krIfojLjpr/Jx8XsDVKSkA8kf6Fiepwb7c dUsfu2xYc6PckMhRQabILclaYvXYPZKc3cQIYoGnRajVIgMBHnPgQj5wsn3GXg0fqb7P n4U7pBPRXgtEj/jtk28oVRzEmsc6otZwKYP5ffBV7KSB6+9xnL8cCMZAsPRCLjAiELC+ s69LUAKxpcPFgC4nEpEy6yNDmQQRVl3yAsIb8tWcnWyK9H8QR6VnoPEayp2pLKwomxpq ZbOA== 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=CcaW1nPaukhEXiXprBAQ1ypKp3C4X7MmOMiLijl8qRY=; b=TIh09BHXc3Dd/qHQNK7ZgNYfh/vb0PJycnuHOADulzfceeh7H8zmGty570bhM2ABvy DaPTLTaeykrOwlosBOHemIBq5L8m5JPR03on8JqE+qZ8cuHb8169/mIbMqQIEH9AoXuH cOC8L3zmpRw4Nh+GuS6h6Wx4lOnGeyAry4Oh54ZVrYQwXk+ttPilwdXLcYPwyqX98HYo qx4ZwIIoctQ7VH95B6Rr0G4nDj42QgfWlSESQ1xXUduq0wGsk8DzMfyuyPaBhi8o3ArR xtUAiWSe6qfSaRQ+HOrRIXqmSYzXm0G3KmDruVPSNiyWI+FBWunekbfzmNYWe13zk1jc psHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RjH9XHI2; 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 hw7si2642348ejc.417.2021.04.17.06.25.16; Sat, 17 Apr 2021 06:25:16 -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=RjH9XHI2; 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 S236432AbhDQNZj (ORCPT + 16 others); Sat, 17 Apr 2021 09:25:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236365AbhDQNZg (ORCPT ); Sat, 17 Apr 2021 09:25:36 -0400 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AF27C061763 for ; Sat, 17 Apr 2021 06:25:08 -0700 (PDT) Received: by mail-qk1-x729.google.com with SMTP id s5so22922658qkj.5 for ; Sat, 17 Apr 2021 06:25:07 -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=CcaW1nPaukhEXiXprBAQ1ypKp3C4X7MmOMiLijl8qRY=; b=RjH9XHI2oJOZeUG94wCXHJ5rvdfUHzbvA8lQHKAw7P1yZyToFuJWcLHvmwPIIp/4bb jYJCV77wE2D7xJx1JRXgOnge9haXxjrHyJ/uJDBapQTX7JaCoDfFGSbI/IQHKV/7xr6g BflkqxHI5R7ImiqgQYw/CuoPIkp+rpi95EbPrRT9PLZcGQJToXpdFA/TRJeEcCdDklNE Ye+Sv1KkJgOm+yiqhWi3HAB573wY7A+toq0Z6l5s9T7461ZwxJ2hHmdp6LPbHxInbXOU lMrqE8etp2feC8Zj4/cO9gpg1nNE38bSYWNXubCtvjtm3BgyKQqOP1qN2SbomD79uT6x 2t1Q== 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=CcaW1nPaukhEXiXprBAQ1ypKp3C4X7MmOMiLijl8qRY=; b=h/DxZ5xQDPjxYCjvBhauFih/7JkWRyiWagBGcDjnJg77lgjMUSV0PR9jaf3QdB1SIP /Amgyl7rGps7HP9v+rrDtL70QUzy9XnnMPo4ZDkpXBB8/yhTMvDrjWPNGWKqdvByDl5K S3vuHA4wHqmZWJBfUXxYSXcV8VuBlyT1KHCTSWhABEEdYg0Eo3NpWUQHMvS/mI3Eou5w jakVnMrjVySrCu+Wam4Fp+HJo8NAb64gHT1imcjh9iIXLntaSH0JtcH+7fDDUeDA5DgU nv5TGIdy8kZIhzdCBKaZsJRxJwYSzZEjPlqawDaVcPpjHJ1gUD1qVtgGyLSvXPnIv7Us Ut5A== X-Gm-Message-State: AOAM531quO5RvvE/1433792aq1QsGSgglC2OB+vMcAl36uQ9HewN/LUc Boyod7c2ULPn2mYQJDYwt7p1Xg== X-Received: by 2002:a05:620a:1391:: with SMTP id k17mr451254qki.274.1618665907188; Sat, 17 Apr 2021 06:25:07 -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 o25sm1988327qtl.37.2021.04.17.06.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 06:25:06 -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 v2 3/7] crypto: qce: Add mode for rfc4309 Date: Sat, 17 Apr 2021 09:24:59 -0400 Message-Id: <20210417132503.1401128-4-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210417132503.1401128-1-thara.gopinath@linaro.org> References: <20210417132503.1401128-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. 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 Reviewed-by: Bjorn Andersson 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)