Re: [PATCH v2 6/7] crypto: omap-aes: Add support for GCM mode

2015-07-08 Thread Lokesh Vutla
On Wednesday 08 July 2015 01:23 PM, Herbert Xu wrote: On Wed, Jul 08, 2015 at 03:48:05PM +0800, Herbert Xu wrote: On Wed, Jul 08, 2015 at 12:29:47PM +0530, Lokesh Vutla wrote: + if (req-assoclen + req-cryptlen == 0) { + scatterwalk_map_and_copy(ctx-auth_tag, req-dst, 0, authlen, +

Re: [PATCH v2 6/7] crypto: omap-aes: Add support for GCM mode

2015-07-08 Thread Lokesh Vutla
On Wednesday 08 July 2015 01:18 PM, Herbert Xu wrote: On Wed, Jul 08, 2015 at 12:29:47PM +0530, Lokesh Vutla wrote: + if (req-assoclen + req-cryptlen == 0) { + scatterwalk_map_and_copy(ctx-auth_tag, req-dst, 0, authlen, + 1); + return 0;

Re: crypto: nx - Fix reentrancy bugs

2015-07-08 Thread Leonidas S. Barbosa
PS it would appear that you can make this completely reentrant by moving all the data from the tfm into the reqeust. Could you work on this and remove the spinlock completely? Yes. Thank you! -- To unsubscribe from this list: send the line unsubscribe linux-crypto in the body of a message

crypto: nx/842 - Fix context corruption

2015-07-08 Thread Herbert Xu
The transform context is shared memory and must not be written to without locking. This patch adds locking to nx-842 to prevent context corruption. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au diff --git a/drivers/crypto/nx/nx-842-crypto.c b/drivers/crypto/nx/nx-842-crypto.c index

Re: akcipher: continuous memory for input/output

2015-07-08 Thread Herbert Xu
On Wed, Jul 08, 2015 at 05:27:15PM +0200, Stephan Mueller wrote: But according to Tadeusz it may be viable to register hybrid asym ciphers with the akcipher API. If there is a full blown hybrid asym cipher we have to handle potentially large chunks of data. I am now wondering whether a

akcipher: continuous memory for input/output

2015-07-08 Thread Stephan Mueller
Hi Herbert, Tadeusz, I looked a bit further into the akcipher code to see how we can add an AF_ALG there. What currently wonders me is the akcipher_request_set_crypt function: the memory for input/output buffers is *no* scatter list but a plain buffer. I think I can understand that for raw

Re: akcipher: continuous memory for input/output

2015-07-08 Thread Stephan Mueller
Am Mittwoch, 8. Juli 2015, 23:29:32 schrieb Herbert Xu: Hi Herbert, On Wed, Jul 08, 2015 at 05:27:15PM +0200, Stephan Mueller wrote: But according to Tadeusz it may be viable to register hybrid asym ciphers with the akcipher API. If there is a full blown hybrid asym cipher we have to handle

Re: [PATCH 00/10] crypto: x86_64 - Add SSE/AVX2 ChaCha20/Poly1305 ciphers

2015-07-08 Thread Herbert Xu
On Wed, Jul 08, 2015 at 10:36:23PM +0200, Martin Willi wrote: I get less constant numbers between different runs when using sec=0, hence I've used sec=1. Below are the numbers of average runs for the AEAD measuring cycles; I'll use cycles in the individual patch notes in a v2. If you're

Re: [PATCH 00/10] crypto: x86_64 - Add SSE/AVX2 ChaCha20/Poly1305 ciphers

2015-07-08 Thread Martin Willi
Herbert, Running the speed test with sec=1 makes no sense because it's too short. Please use sec=0 and count cycles instead. I get less constant numbers between different runs when using sec=0, hence I've used sec=1. Below are the numbers of average runs for the AEAD measuring cycles; I'll

Re: [PATCH v2 6/7] crypto: omap-aes: Add support for GCM mode

2015-07-08 Thread Lokesh Vutla
On Wednesday 08 July 2015 09:48 AM, Herbert Xu wrote: On Tue, Jul 07, 2015 at 09:01:48PM +0530, Lokesh Vutla wrote: +static int omap_aes_gcm_copy_buffers(struct omap_aes_dev *dd, + struct aead_request *req) +{ +void *buf_in; +int pages, alen, clen,

Re: [PATCH v2 0/7] crypto: omap-aes: Add support for GCM mode

2015-07-08 Thread Herbert Xu
On Tue, Jul 07, 2015 at 09:01:42PM +0530, Lokesh Vutla wrote: This series does some basic cleanup and adds support for AES GCM mode for omap aes driver. Changes since v1: - Switched GCM to new AEAD interface Patches 1-4 and 7 applied. Cheers, -- Email: Herbert Xu

Re: [PATCH v2 5/7] crypto: aead: Add aead_request_cast() api

2015-07-08 Thread Lokesh Vutla
On Wednesday 08 July 2015 09:26 AM, Herbert Xu wrote: On Tue, Jul 07, 2015 at 09:01:47PM +0530, Lokesh Vutla wrote: Add aead_request_cast() api to get pointer to aead_request from cryto_async_request. Signed-off-by: Lokesh Vutla lokeshvu...@ti.com --- include/crypto/internal/aead.h | 6

[PATCH 13/14] crypto: caam - Use new IV convention

2015-07-08 Thread Herbert Xu
This patch converts rfc4106 to the new calling convention where the IV is now part of the AD and needs to be skipped. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- drivers/crypto/caam/caamalg.c | 75 +++--- 1 file changed, 49 insertions(+), 26

[PATCH 6/14] crypto: seqiv - Replace seqniv with seqiv

2015-07-08 Thread Herbert Xu
This patch replaces the seqniv generator with seqiv when the underlying algorithm understands the new calling convention. This not only makes more sense as now seqiv is solely responsible for IV generation rather than also determining how the IV is going to be used, it also allows for

[PATCH 4/14] crypto: cryptd - Propagate new AEAD implementation flag

2015-07-08 Thread Herbert Xu
This patch allows the CRYPTO_ALG_AEAD_NEW flag to be propagated. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- crypto/cryptd.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crypto/cryptd.c b/crypto/cryptd.c index 2f833dc..360ee85 100644 ---

[PATCH 8/14] crypto: testmgr - Disable rfc4106 test and convert test vectors

2015-07-08 Thread Herbert Xu
This patch disables the rfc4106 test while the conversion to the new seqiv calling convention takes place. It also converts the rfc4106 test vectors to the new format. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- crypto/testmgr.c |2 crypto/testmgr.h | 602

[PATCH 7/14] crypto: aead - Propagate new AEAD implementation flag for IV generators

2015-07-08 Thread Herbert Xu
This patch allows the CRYPTO_ALG_AEAD_NEW flag to be propagated. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- crypto/aead.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/aead.c b/crypto/aead.c index 8cd45a7..1a5b118 100644 --- a/crypto/aead.c

[PATCH 2/14] crypto: aead - Add type-safe function for freeing instances

2015-07-08 Thread Herbert Xu
This patch adds a type-safe function for freeing AEAD instances to struct aead_instance. This replaces the existing free function in struct crypto_template which does not know the type of the instance that it's freeing. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- crypto/aead.c

[PATCH 11/14] crypto: gcm - Use new IV convention

2015-07-08 Thread Herbert Xu
This patch converts rfc4106 to the new calling convention where the IV is now part of the AD and needs to be skipped. This patch also makes use of the new type-safe way of freeing instances. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- crypto/gcm.c | 114

[PATCH 3/14] crypto: pcrypt - Propagate new AEAD implementation flag

2015-07-08 Thread Herbert Xu
This patch allows the CRYPTO_ALG_AEAD_NEW flag to be propagated. It also restores the ASYNC bit that went missing during the AEAD conversion. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- crypto/pcrypt.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff

[PATCH 10/14] crypto: aesni - Use new IV convention

2015-07-08 Thread Herbert Xu
This patch converts rfc4106 to the new calling convention where the IV is now in the AD and needs to be skipped. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- arch/x86/crypto/aesni-intel_glue.c | 56 + 1 file changed, 20 insertions(+), 36

[PATCH 5/14] crypto: echainiv - Fix encryption convention

2015-07-08 Thread Herbert Xu
This patch fixes a bug where we were incorrectly including the IV in the AD during encryption. The IV must remain in the plain text for it to be encrypted. During decryption there is no need to copy the IV to dst because it's now part of the AD. This patch removes an unncessary check on

[PATCH 12/14] crypto: nx - Use new IV convention

2015-07-08 Thread Herbert Xu
This patch converts rfc4106 to the new calling convention where the IV is now part of the AD and needs to be skipped. This patch also makes use of type-safe AEAD functions where possible. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- drivers/crypto/nx/nx-aes-gcm.c | 66

[PATCH 1/14] crypto: api - Add instance free function to crypto_type

2015-07-08 Thread Herbert Xu
Currently the task of freeing an instance is given to the crypto template. However, it has no type information on the instance so we have to resort to checking type information at runtime. This patch introduces a free function to crypto_type that will be used to free an instance. This can then

[PATCH 9/14] crypto: tcrypt - Add support for new IV convention

2015-07-08 Thread Herbert Xu
This patch allows the AEAD speed tests to cope with the new seqiv calling convention as well as the old one. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- crypto/tcrypt.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crypto/tcrypt.c

[PATCH 14/14] crypto: testmgr - Reenable rfc4106 test

2015-07-08 Thread Herbert Xu
Now that all implementations of rfc4106 have been converted we can reenable the test. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au --- crypto/testmgr.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index c4fe6a8..d0a42bd