Re: [v2 PATCH 13/13] crypto: algif_aead - Switch to new AEAD interface

2015-05-23 Thread Herbert Xu
On Sat, May 23, 2015 at 08:04:19PM +0200, Stephan Mueller wrote: > Am Freitag, 22. Mai 2015, 16:31:04 schrieb Herbert Xu: > > Hi Herbert, > > > This patch makes use of the new AEAD interface which uses a single > > SG list instead of separate lists for the AD and plain text. > > After applying y

Re: [PATCH v9 4/4] crypto: Add Allwinner Security System crypto accelerator

2015-05-23 Thread Herbert Xu
On Sat, May 23, 2015 at 04:35:36PM +0200, Boris Brezillon wrote: > > > Since all SG I get was always a multiple of 16 (AES BLOCK SIZE) it was a > > sort of confirmation. > > > > Herbert ? does am I right or a chunking test is missing for cbc(aes) in > > testmgr.h > > Okay, just sharing my visio

Re: [linux-sunxi] Re: [PATCH v9 4/4] crypto: Add Allwinner Security System crypto accelerator

2015-05-23 Thread Herbert Xu
On Sat, May 23, 2015 at 02:18:06PM +0200, Corentin LABBE wrote: > > What do you think about adding a BUG_ON(in_atomic()) in > crypto_ablkcipher_setkey() ? Just add a might_sleep() to it. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.o

Re: [v2 PATCH 13/13] crypto: algif_aead - Switch to new AEAD interface

2015-05-23 Thread Stephan Mueller
Am Freitag, 22. Mai 2015, 16:31:04 schrieb Herbert Xu: Hi Herbert, > This patch makes use of the new AEAD interface which uses a single > SG list instead of separate lists for the AD and plain text. After applying your additional patch, the "normal" AEAD operation works. But with long messages

Re: [v2 PATCH 13/13] crypto: algif_aead - Switch to new AEAD interface

2015-05-23 Thread Stephan Mueller
Am Samstag, 23. Mai 2015, 05:58:18 schrieb Herbert Xu: Hi Herbert, > On Fri, May 22, 2015 at 11:04:39PM +0200, Stephan Mueller wrote: > > Note, gcm(aes) looks good. Only rfc4106(gcm(aes)) causes the crash. > > Actually it looks like the culprit hasn't been merged yet so I'll > just respin the se

Re: [PATCH v9 4/4] crypto: Add Allwinner Security System crypto accelerator

2015-05-23 Thread Boris Brezillon
Hi Corentin, On Sat, 23 May 2015 15:12:23 +0200 Corentin LABBE wrote: > Le 17/05/2015 10:45, Boris Brezillon a écrit : > > Hi Corentin, > > > > I started to review this new version, and I still think there's > > something wrong with the way your processing crypto requests. > > From my POV this

Re: [PATCH RFC v2 1/2] crypto: add PKE API

2015-05-23 Thread Tadeusz Struk
On 05/22/2015 10:47 PM, Herbert Xu wrote: >> struct akcipher_request { >> >struct crypto_async_request base; >> >struct scatterlist *inparams; >> >struct scatterlist *outparams; >> >void *__ctx[] CRYPTO_MINALIGN_ATTR; >> > }; > I think you should rename them to src/dst and add a len

Re: [PATCH v9 4/4] crypto: Add Allwinner Security System crypto accelerator

2015-05-23 Thread Corentin LABBE
Le 17/05/2015 10:45, Boris Brezillon a écrit : > Hi Corentin, > > I started to review this new version, and I still think there's > something wrong with the way your processing crypto requests. > From my POV this is not asynchronous at all (see my comments inline), > but maybe Herbert can confirm

Re: [linux-sunxi] Re: [PATCH v9 4/4] crypto: Add Allwinner Security System crypto accelerator

2015-05-23 Thread Corentin LABBE
Le 15/05/2015 08:49, Herbert Xu a écrit : > On Thu, May 14, 2015 at 02:59:01PM +0200, LABBE Corentin wrote: >> >> +err = crypto_ablkcipher_setkey(op->fallback, kkey, op->keylen); >> +if (err != 0) { >> +dev_err(ss->dev, "Cannot set key on fallback\n"); >> +return -EI

Re: [PATCH v9 1/4] ARM: sun7i: dt: Add Security System to A20 SoC DTS

2015-05-23 Thread Corentin LABBE
Le 15/05/2015 09:31, Maxime Ripard a écrit : > On Thu, May 14, 2015 at 02:58:58PM +0200, LABBE Corentin wrote: >> The Security System is a hardware cryptographic accelerator that support >> AES/MD5/SHA1/DES/3DES/PRNG algorithms. >> It could be found on many Allwinner SoC. >> >> This patch enable th

[PATCH 3/8] crypto: seqiv - Use aead_register_instance

2015-05-23 Thread Herbert Xu
New style AEAD instances must use aead_register_instance. This worked by chance because aead_geniv_alloc is still setting things the old way. This patch converts the template over to the create model where we are responsible for instance registration so that we can call the correct function. Sig

[PATCH 5/8] crypto: aead - Do not set cra_type for new style instances

2015-05-23 Thread Herbert Xu
The function aead_geniv_alloc currently sets cra_type even for new style instances. This is unnecessary and may hide bugs such as when our caller uses crypto_register_instance instead of the correct aead_register_instance. Signed-off-by: Herbert Xu --- crypto/aead.c |4 +--- 1 file changed

[PATCH 7/8] crypto: seqiv - Stop using cryptoff

2015-05-23 Thread Herbert Xu
The cryptoff parameter was added to facilitate the skipping of IVs that sit between the AD and the plain/cipher text. However, it was never implemented correctly as and we do not handle users such as IPsec setting cryptoff. It is simply ignored. Implementing correctly is in fact more trouble tha

[PATCH 6/8] crypto: echainiv - Stop using cryptoff

2015-05-23 Thread Herbert Xu
The cryptoff parameter was added to facilitate the skipping of IVs that sit between the AD and the plain/cipher text. However, it was never implemented correctly as and we do not handle users such as IPsec setting cryptoff. It is simply ignored. Implementing correctly is in fact more trouble tha

[PATCH 8/8] crypto: aead - Remove unused cryptoff parameter

2015-05-23 Thread Herbert Xu
This patch removes the cryptoff parameter now that all users set it to zero. Signed-off-by: Herbert Xu --- crypto/aead.c |6 ++ crypto/echainiv.c |4 ++-- crypto/seqiv.c|8 include/crypto/aead.h |7 +-- 4 files changed, 9 insertions(+), 16 de

[PATCH 4/8] crypto: echainiv - Use aead_register_instance

2015-05-23 Thread Herbert Xu
New style AEAD instances must use aead_register_instance. This worked by chance because aead_geniv_alloc is still setting things the old way. This patch converts the template over to the create model where we are responsible for instance registration so that we can call the correct function. Sig

[PATCH 1/8] crypto: skcipher - Use tmpl->create

2015-05-23 Thread Herbert Xu
Newer templates use tmpl->create and have a NULL tmpl->alloc. So we must use tmpl->create if it is set. Signed-off-by: Herbert Xu --- crypto/ablkcipher.c |8 1 file changed, 8 insertions(+) diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index b3dded4..b15d797 100644 --- a

[PATCH 2/8] crypto: aead - Use tmpl->create

2015-05-23 Thread Herbert Xu
Newer templates use tmpl->create and have a NULL tmpl->alloc. So we must use tmpl->create if it is set. Signed-off-by: Herbert Xu --- crypto/aead.c |8 1 file changed, 8 insertions(+) diff --git a/crypto/aead.c b/crypto/aead.c index c1f73a9..a6385bd 100644 --- a/crypto/aead.c +++

[PATCH 0/8] crypto: aead - Use type-safe instance registration and remove cryptoff

2015-05-23 Thread Herbert Xu
Hi: This series of patches makes the new seqiv/echainiv implementation use the type-safe instance registration mechanism. It also removes the cryptoff parameter from the new AEAD interface. The cryptoff parameter only existed to ease the pain on implementing seqniv (i.e., skipping IV when generat