[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c360d691-8253-bd99-af92-83d9f8e86a2d@nxp.com>
Date: Tue, 8 Sep 2020 13:35:04 +0300
From: Horia Geantă <horia.geanta@....com>
To: Herbert Xu <herbert@...dor.apana.org.au>,
"Andrei Botila (OSS)" <andrei.botila@....nxp.com>
Cc: Aymen Sghaier <aymen.sghaier@....com>,
"David S. Miller" <davem@...emloft.net>,
"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Ard Biesheuvel <ardb@...nel.org>
Subject: Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with
more than 8B IV
On 8/21/2020 6:47 AM, Herbert Xu wrote:
> On Thu, Aug 06, 2020 at 07:35:43PM +0300, Andrei Botila wrote:
>>
>> +static bool xts_skcipher_ivsize(struct skcipher_request *req)
>> +{
>> + struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
>> + unsigned int ivsize = crypto_skcipher_ivsize(skcipher);
>> + u64 size = 0;
>> +
>> + if (IS_ALIGNED((unsigned long)req->iv, __alignof__(u64)))
>> + size = *(u64 *)(req->iv + (ivsize / 2));
>> + else
>> + size = get_unaligned((u64 *)(req->iv + (ivsize / 2)));
>> +
>> + return !!size;
>> +}
>
> Just go with the get_unaligned unconditionally.
>
Won't this lead to sub-optimal code for ARMv7
in case the IV is aligned?
Thanks,
Horia
Powered by blists - more mailing lists