Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-29 Thread Herbert Xu
On Fri, May 29, 2020 at 03:41:08PM +0200, Ard Biesheuvel wrote: > > So what about the final request? At which point do you decide to > return the final chunk of data that you have been holding back in > order to ensure that you can perform the final processing correctly if > it is not being followe

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-29 Thread Ard Biesheuvel
On Fri, 29 May 2020 at 15:19, Herbert Xu wrote: > > On Fri, May 29, 2020 at 03:10:43PM +0200, Ard Biesheuvel wrote: > > > > OK, so the undocumented assumption is that algif_skcipher requests are > > delineated by ALG_SET_IV commands, and that anything that gets sent to > > the socket in between sh

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-29 Thread Herbert Xu
On Fri, May 29, 2020 at 03:10:43PM +0200, Ard Biesheuvel wrote: > > OK, so the undocumented assumption is that algif_skcipher requests are > delineated by ALG_SET_IV commands, and that anything that gets sent to > the socket in between should be treated as a single request, right? I Correct. > th

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-29 Thread Ard Biesheuvel
On Fri, 29 May 2020 at 14:02, Herbert Xu wrote: > > On Fri, May 29, 2020 at 02:00:14PM +0200, Ard Biesheuvel wrote: > > > > Even if this is the case, it requires that an skcipher implementation > > stores an output IV in the buffer that skcipher request's IV field > > points to. Currently, we only

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-29 Thread Herbert Xu
On Fri, May 29, 2020 at 02:00:14PM +0200, Ard Biesheuvel wrote: > > Even if this is the case, it requires that an skcipher implementation > stores an output IV in the buffer that skcipher request's IV field > points to. Currently, we only check whether this is the case for CBC > implementations, an

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-29 Thread Ard Biesheuvel
On Fri, 29 May 2020 at 13:51, Herbert Xu wrote: > > On Fri, May 29, 2020 at 10:20:27AM +0200, Ard Biesheuvel wrote: > > > > But many implementation do not return an output IV at all. The only > > mode that requires it (for the selftests to pass) is CBC. > > Most modes can be chained, e.g., CBC, PC

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-29 Thread Herbert Xu
On Fri, May 29, 2020 at 10:20:27AM +0200, Ard Biesheuvel wrote: > > But many implementation do not return an output IV at all. The only > mode that requires it (for the selftests to pass) is CBC. Most modes can be chained, e.g., CBC, PCBC, OFB, CFB and CTR. As it stands algif_skcipher requres all

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-29 Thread Ard Biesheuvel
On Fri, 29 May 2020 at 10:05, Herbert Xu wrote: > > On Thu, May 28, 2020 at 10:33:25AM +0200, Ard Biesheuvel wrote: > > > > The reason we return output IVs for CBC is because our generic > > implementation of CTS can wrap any CBC implementation, and relies on > > this output IV rather than grabbin

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-29 Thread Herbert Xu
On Thu, May 28, 2020 at 10:33:25AM +0200, Ard Biesheuvel wrote: > > The reason we return output IVs for CBC is because our generic > implementation of CTS can wrap any CBC implementation, and relies on > this output IV rather than grabbing it from the ciphertext directly > (which may be tricky and

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-28 Thread Ard Biesheuvel
On Thu, 28 May 2020 at 09:33, Herbert Xu wrote: > > Ard Biesheuvel wrote: > > Stephan reports that the arm64 implementation of cts(cbc(aes)) deviates > > from the generic implementation in what it returns as the output IV. So > > fix this, and add some test vectors to catch other non-compliant >

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-28 Thread Herbert Xu
Ard Biesheuvel wrote: > Stephan reports that the arm64 implementation of cts(cbc(aes)) deviates > from the generic implementation in what it returns as the output IV. So > fix this, and add some test vectors to catch other non-compliant > implementations. > > Stephan, could you provide a referenc

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-23 Thread Ard Biesheuvel
On Sat, 23 May 2020 at 20:52, Stephan Müller wrote: > > Am Donnerstag, 21. Mai 2020, 15:23:41 CEST schrieb Ard Biesheuvel: > > Hi Ard, > > > On Thu, 21 May 2020 at 15:01, Gilad Ben-Yossef wrote: > > > Hi Ard, > > > > > > Thank you for looping me in. > > > > > > On Wed, May 20, 2020 at 10:09 AM Ar

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-23 Thread Stephan Müller
Am Donnerstag, 21. Mai 2020, 15:23:41 CEST schrieb Ard Biesheuvel: Hi Ard, > On Thu, 21 May 2020 at 15:01, Gilad Ben-Yossef wrote: > > Hi Ard, > > > > Thank you for looping me in. > > > > On Wed, May 20, 2020 at 10:09 AM Ard Biesheuvel wrote: > > > On Wed, 20 May 2020 at 09:01, Stephan Muelle

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-21 Thread Ard Biesheuvel
On Thu, 21 May 2020 at 15:01, Gilad Ben-Yossef wrote: > > Hi Ard, > > Thank you for looping me in. > > On Wed, May 20, 2020 at 10:09 AM Ard Biesheuvel wrote: > > > > On Wed, 20 May 2020 at 09:01, Stephan Mueller wrote: > > > > > > Am Mittwoch, 20. Mai 2020, 08:54:10 CEST schrieb Ard Biesheuvel:

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-21 Thread Gilad Ben-Yossef
Hi Ard, Thank you for looping me in. On Wed, May 20, 2020 at 10:09 AM Ard Biesheuvel wrote: > > On Wed, 20 May 2020 at 09:01, Stephan Mueller wrote: > > > > Am Mittwoch, 20. Mai 2020, 08:54:10 CEST schrieb Ard Biesheuvel: > > > > Hi Ard, > > > > > On Wed, 20 May 2020 at 08:47, Stephan Mueller

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-20 Thread Ard Biesheuvel
On Wed, 20 May 2020 at 09:01, Stephan Mueller wrote: > > Am Mittwoch, 20. Mai 2020, 08:54:10 CEST schrieb Ard Biesheuvel: > > Hi Ard, > > > On Wed, 20 May 2020 at 08:47, Stephan Mueller wrote: ... > > > The state of all block chaining modes we currently have is defined with > > > the > > > IV. Th

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-20 Thread Stephan Mueller
Am Mittwoch, 20. Mai 2020, 08:54:10 CEST schrieb Ard Biesheuvel: Hi Ard, > On Wed, 20 May 2020 at 08:47, Stephan Mueller wrote: > > Am Mittwoch, 20. Mai 2020, 08:40:57 CEST schrieb Ard Biesheuvel: > > > > Hi Ard, > > > > > On Wed, 20 May 2020 at 08:03, Stephan Mueller wrote: > > > > Am Diens

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-19 Thread Ard Biesheuvel
On Wed, 20 May 2020 at 08:47, Stephan Mueller wrote: > > Am Mittwoch, 20. Mai 2020, 08:40:57 CEST schrieb Ard Biesheuvel: > > Hi Ard, > > > On Wed, 20 May 2020 at 08:03, Stephan Mueller wrote: > > > Am Dienstag, 19. Mai 2020, 21:02:09 CEST schrieb Ard Biesheuvel: > > > > > > Hi Ard, > > > > > > >

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-19 Thread Stephan Mueller
Am Mittwoch, 20. Mai 2020, 08:40:57 CEST schrieb Ard Biesheuvel: Hi Ard, > On Wed, 20 May 2020 at 08:03, Stephan Mueller wrote: > > Am Dienstag, 19. Mai 2020, 21:02:09 CEST schrieb Ard Biesheuvel: > > > > Hi Ard, > > > > > Stephan reports that the arm64 implementation of cts(cbc(aes)) deviates

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-19 Thread Ard Biesheuvel
On Wed, 20 May 2020 at 08:03, Stephan Mueller wrote: > > Am Dienstag, 19. Mai 2020, 21:02:09 CEST schrieb Ard Biesheuvel: > > Hi Ard, > > > Stephan reports that the arm64 implementation of cts(cbc(aes)) deviates > > from the generic implementation in what it returns as the output IV. So > > fix th

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-19 Thread Stephan Mueller
Am Dienstag, 19. Mai 2020, 21:02:09 CEST schrieb Ard Biesheuvel: Hi Ard, > Stephan reports that the arm64 implementation of cts(cbc(aes)) deviates > from the generic implementation in what it returns as the output IV. So > fix this, and add some test vectors to catch other non-compliant > impleme

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-19 Thread Ard Biesheuvel
(add Gilad for cc-ree) On Tue, 19 May 2020 at 21:02, Ard Biesheuvel wrote: > > Stephan reports that the arm64 implementation of cts(cbc(aes)) deviates > from the generic implementation in what it returns as the output IV. So > fix this, and add some test vectors to catch other non-compliant > imp