From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9C3BC433EF for ; Mon, 11 Apr 2022 08:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ljwAJ4GPSMunYrH+rv0I13NnvpAFSbjra98KM+Fyz24=; b=KUXjZc384w9rNL XNrdCDeRZ9K8iZtxVOS0ysUW5t4FTl39XHuWS6nD11CAH9F8pONtbzR9UfIjQmz0BMF5/tenVuMqr uoc7XtVBRp2v82dPfeGo1uS4LCR5YG+lJEwBjJ1F+yBr9pC6Z0sZ8AZiPIbp/z0UoUea8FMKSNGom 74G7QV6bi1jRT4qacRXPkRq+iZsOefvlacmLWv4a4ZLT8ZQmSqTUR9xKvhPz5kMa3M/5NisxM+pAs OEpngStz8T/Ee5LDiaVUcjhiEqYPTadV57ZizfiBADSkqAo/uL0THiEtxPT390Au2oQcjNBwuDi1q SCQnbajWPaEGUjutkpEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndpm4-007eBs-CH; Mon, 11 Apr 2022 08:51:52 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndplu-007e4x-MD for linux-arm-kernel@lists.infradead.org; Mon, 11 Apr 2022 08:51:44 +0000 Received: by mail-wr1-x42f.google.com with SMTP id u3so21949441wrg.3 for ; Mon, 11 Apr 2022 01:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=IXFXkZ/zIPR/vpj7KNO5NDwB6CMm+azUma0NGH5YVgU=; b=DU1x7RrLRqhM32z2qCQqJ8a/bsJ1Es12ZQaw54KzV/aumf31lk1TLA1cpv4cZI8Ml0 I+PBZQ513P+Kl+A/cS98JJNei9ccl78hSmxjsg7XW11/rh3t9Ybra6WILnO2jHnWVw03 d99k42th8WeHxcw1YDHY+O1+QzALwhvy3AH1pZW142gprxVanbAPJMWDcfOlCMCwxITt 0bDMQgwZrIbdNbhNstZ0ncbZD4ArqB/X32ZlX0JK3qVtYtPbKZ7UwF7Z7vjQOIhIkgsF hcglTWYerpYvHtIhiNnQjyVGp4qBPBlKNsdrpzUAw6LdVPJPh8vkURTvWG+uDP3P+36m kpSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=IXFXkZ/zIPR/vpj7KNO5NDwB6CMm+azUma0NGH5YVgU=; b=tIUxAhv/Os1+Z9uRiKY283dEYF9bJSm9cRCK8JXpzMMRjeShn3fgJef4x4UJeOao6+ nRxLA/tEwpsgBgKK1tmzpOyoP2ZGQWNiEtDdzqK6Eae3A6R165p53rrvVTSoynPaapaC wJ9sm/wAcS5bgPRNqkBRinStfID0E02GpAyD7R/TBusCg+U8flEnI8wZ0LTe73+tnmC9 EACbqtINLlW4j4jk3k/KQYv18imTq+lM2+uMaGi7m0v5FHuyvk4TnEuA1jct85uM00Nr XLIvTMh+aI3+UT8agOqJ8DKi99cxZdD3AfiY0Z/cGF5xkHkercrO8g4cTuog/D3ZBKCo xGnw== X-Gm-Message-State: AOAM530pnbVbfsJQ/KHHpnvb1Zj5AXU1+5PVfJAZYPByCNUshQ7LvY4c 3x/ThxlTKDu96XUz3jlK8q7y2A== X-Google-Smtp-Source: ABdhPJwBIvnDClmMj7lyqH8WolBn46vICihfyKzrStW5W+VTLqQQ9byyWSgWtWbeDhcHuG4qEqGRgQ== X-Received: by 2002:a05:6000:15cb:b0:207:97e4:e445 with SMTP id y11-20020a05600015cb00b0020797e4e445mr11520814wry.672.1649667100481; Mon, 11 Apr 2022 01:51:40 -0700 (PDT) Received: from Red ([2a01:cb1d:3d5:a100:264b:feff:fe03:2806]) by smtp.googlemail.com with ESMTPSA id y15-20020a056000168f00b002057a9f9f5csm30881650wrd.31.2022.04.11.01.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 01:51:39 -0700 (PDT) Date: Mon, 11 Apr 2022 10:51:38 +0200 From: LABBE Corentin To: John Keeping Cc: heiko@sntech.de, herbert@gondor.apana.org.au, krzk+dt@kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH v4 08/33] crypto: rockchip: better handle cipher key Message-ID: References: <20220401201804.2867154-1-clabbe@baylibre.com> <20220401201804.2867154-9-clabbe@baylibre.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220411_015142_805557_BDB4EAE9 X-CRM114-Status: GOOD ( 20.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Le Mon, Apr 04, 2022 at 12:31:11PM +0100, John Keeping a =E9crit : > On Fri, Apr 01, 2022 at 08:17:39PM +0000, Corentin Labbe wrote: > > The key should not be set in hardware too much in advance, this will > > fail it 2 TFM with different keys generate alternative requests. > > The key should be stored and used just before doing cipher operations. > > = > > Fixes: ce0183cb6464b ("crypto: rockchip - switch to skcipher API") > > Signed-off-by: Corentin Labbe > > --- > > drivers/crypto/rockchip/rk3288_crypto.h | 1 + > > drivers/crypto/rockchip/rk3288_crypto_skcipher.c | 10 +++++++--- > > 2 files changed, 8 insertions(+), 3 deletions(-) > > = > > diff --git a/drivers/crypto/rockchip/rk3288_crypto.h b/drivers/crypto/r= ockchip/rk3288_crypto.h > > index 8b1e15d8ddc6..826508e4a0c3 100644 > > --- a/drivers/crypto/rockchip/rk3288_crypto.h > > +++ b/drivers/crypto/rockchip/rk3288_crypto.h > > @@ -245,6 +245,7 @@ struct rk_ahash_rctx { > > struct rk_cipher_ctx { > > struct rk_crypto_info *dev; > > unsigned int keylen; > > + u32 key[AES_MAX_KEY_SIZE / 4]; > = > Should this be u8? It's only ever memcpy'd so the fact the registers > are 32-bit is irrelevant. > = > (Also a very minor nit: this should probably be aligned in the same was > as the above two variables.) Yes, it could be u8 and I will fix the alignement. Regards _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel