Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-09-15 Thread Ard Biesheuvel
On Tue, 15 Sep 2020 at 15:45, Horia Geantă wrote: > > On 9/15/2020 1:26 PM, Ard Biesheuvel wrote: > > On Tue, 15 Sep 2020 at 13:02, Horia Geantă wrote: > >> > >> On 9/14/2020 9:20 PM, Ard Biesheuvel wrote: > >>> On Mon, 14 Sep 2020 at 20:12, Horia Geantă wrote: > > On 9/14/2020 7:28

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-09-15 Thread Horia Geantă
On 9/15/2020 1:26 PM, Ard Biesheuvel wrote: > On Tue, 15 Sep 2020 at 13:02, Horia Geantă wrote: >> >> On 9/14/2020 9:20 PM, Ard Biesheuvel wrote: >>> On Mon, 14 Sep 2020 at 20:12, Horia Geantă wrote: On 9/14/2020 7:28 PM, Ard Biesheuvel wrote: > On Mon, 14 Sep 2020 at 19:24, Horia

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-09-15 Thread Ard Biesheuvel
On Tue, 15 Sep 2020 at 13:02, Horia Geantă wrote: > > On 9/14/2020 9:20 PM, Ard Biesheuvel wrote: > > On Mon, 14 Sep 2020 at 20:12, Horia Geantă wrote: > >> > >> On 9/14/2020 7:28 PM, Ard Biesheuvel wrote: > >>> On Mon, 14 Sep 2020 at 19:24, Horia Geantă wrote: > > On 9/9/2020 1:10

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-09-15 Thread Horia Geantă
On 9/14/2020 9:20 PM, Ard Biesheuvel wrote: > On Mon, 14 Sep 2020 at 20:12, Horia Geantă wrote: >> >> On 9/14/2020 7:28 PM, Ard Biesheuvel wrote: >>> On Mon, 14 Sep 2020 at 19:24, Horia Geantă wrote: On 9/9/2020 1:10 AM, Herbert Xu wrote: > On Tue, Sep 08, 2020 at 01:35:04PM +0300,

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-09-14 Thread Ard Biesheuvel
On Mon, 14 Sep 2020 at 20:12, Horia Geantă wrote: > > On 9/14/2020 7:28 PM, Ard Biesheuvel wrote: > > On Mon, 14 Sep 2020 at 19:24, Horia Geantă wrote: > >> > >> On 9/9/2020 1:10 AM, Herbert Xu wrote: > >>> On Tue, Sep 08, 2020 at 01:35:04PM +0300, Horia Geantă wrote: > > > Just go with

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-09-14 Thread Horia Geantă
On 9/14/2020 7:28 PM, Ard Biesheuvel wrote: > On Mon, 14 Sep 2020 at 19:24, Horia Geantă wrote: >> >> On 9/9/2020 1:10 AM, Herbert Xu wrote: >>> On Tue, Sep 08, 2020 at 01:35:04PM +0300, Horia Geantă wrote: > Just go with the get_unaligned unconditionally. Won't this lead to

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-09-14 Thread Ard Biesheuvel
On Mon, 14 Sep 2020 at 19:24, Horia Geantă wrote: > > On 9/9/2020 1:10 AM, Herbert Xu wrote: > > On Tue, Sep 08, 2020 at 01:35:04PM +0300, Horia Geantă wrote: > >> > >>> Just go with the get_unaligned unconditionally. > >> > >> Won't this lead to sub-optimal code for ARMv7 > >> in case the IV is

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-09-14 Thread Horia Geantă
On 9/9/2020 1:10 AM, Herbert Xu wrote: > On Tue, Sep 08, 2020 at 01:35:04PM +0300, Horia Geantă wrote: >> >>> Just go with the get_unaligned unconditionally. >> >> Won't this lead to sub-optimal code for ARMv7 >> in case the IV is aligned? > > If this should be optimised in ARMv7 then that should

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-09-08 Thread Herbert Xu
On Tue, Sep 08, 2020 at 01:35:04PM +0300, Horia Geantă wrote: > > > Just go with the get_unaligned unconditionally. > > Won't this lead to sub-optimal code for ARMv7 > in case the IV is aligned? If this should be optimised in ARMv7 then that should be done in get_unaligned itself and not

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-09-08 Thread Horia Geantă
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 =

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-08-21 Thread Horia Geantă
On 8/21/2020 6:47 AM, Herbert Xu wrote: > On Tue, Aug 11, 2020 at 05:30:41PM +0300, Horia Geantă wrote: >> >>> + if (IS_ERR(fallback)) { >>> + pr_err("Failed to allocate %s fallback: %ld\n", >>> + tfm_name, PTR_ERR(fallback)); >>> +

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-08-20 Thread Herbert Xu
On Tue, Aug 11, 2020 at 05:30:41PM +0300, Horia Geantă wrote: > > > + if (IS_ERR(fallback)) { > > + pr_err("Failed to allocate %s fallback: %ld\n", > > + tfm_name, PTR_ERR(fallback)); > > + return PTR_ERR(fallback); > Shouldn't

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-08-20 Thread Herbert Xu
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; > + >

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-08-19 Thread Sasha Levin
Hi [This is an automated email] This commit has been processed because it contains a "Fixes:" tag fixing commit: c6415a6016bf ("crypto: caam - add support for acipher xts(aes)"). The bot has tested the following trees: v5.8.1, v5.7.15, v5.4.58, v4.19.139, v4.14.193, v4.9.232, v4.4.232.

Re: [PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-08-11 Thread Horia Geantă
On 8/6/2020 7:36 PM, Andrei Botila (OSS) wrote: > @@ -3344,12 +3382,30 @@ static int caam_cra_init(struct crypto_skcipher *tfm) > struct caam_skcipher_alg *caam_alg = > container_of(alg, typeof(*caam_alg), skcipher); > struct caam_ctx *ctx = crypto_skcipher_ctx(tfm); > +

[PATCH RESEND 1/9] crypto: caam/jr - add fallback for XTS with more than 8B IV

2020-08-06 Thread Andrei Botila
From: Andrei Botila A hardware limitation exists for CAAM until Era 9 which restricts the accelerator to IVs with only 8 bytes. When CAAM has a lower era a fallback is necessary to process 16 bytes IV. Fixes: c6415a6016bf ("crypto: caam - add support for acipher xts(aes)") Cc: # v4.4+