[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48a802bc-e79a-f243-f680-59434106048c@nxp.com>
Date: Tue, 11 Aug 2020 17:36:40 +0300
From: Horia Geantă <horia.geanta@....com>
To: "Andrei Botila (OSS)" <andrei.botila@....nxp.com>,
Aymen Sghaier <aymen.sghaier@....com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>
Cc: "linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RESEND 4/9] crypto: caam/jr - add support for more XTS key
lengths
On 8/6/2020 7:36 PM, Andrei Botila (OSS) wrote:
> @@ -1790,7 +1792,9 @@ static inline int skcipher_crypt(struct skcipher_request *req, bool encrypt)
> if (!req->cryptlen)
> return 0;
>
> - if (ctx->fallback && xts_skcipher_ivsize(req)) {
> + if (ctx->fallback && (xts_skcipher_ivsize(req) ||
> + (ctx->cdata.keylen != 2 * AES_KEYSIZE_128 &&
> + ctx->cdata.keylen != 2 * AES_KEYSIZE_256))) {
Let's avoid doing this check for every request.
This could be achieved by moving it into the .setkey callback and
setting a flag in the caam_ctx indicating if the fallback is needed or not
for this tfm.
Horia
Powered by blists - more mailing lists