[PATCH v2] crypto: vmx - VMX crypto should depend on CONFIG_VSX

2015-09-09 Thread Michael Ellerman
This code uses FP (floating point), Altivec and VSX (Vector-Scalar Extension). It can just depend on CONFIG_VSX though, because that already depends on FP and Altivec. Otherwise we get lots of link errors such as: drivers/built-in.o: In function `.p8_aes_setkey': aes.c:(.text+0x2d325c):

[PATCH] crypto: sun4i-ss Fix a possible driver hang with ciphers

2015-09-09 Thread LABBE Corentin
The sun4i_ss_opti_poll function cipher data until the output miter have a length of 0. If the crypto API client, give more SGs than necessary this could result in an infinite loop. Fix it by checking for remaining bytes, just like sun4i_ss_cipher_poll(). Signed-off-by: LABBE Corentin

Re: USB HID devices not linked to RNG

2015-09-09 Thread Stephan Mueller
Am Dienstag, 8. September 2015, 22:40:07 schrieb Dmitry Torokhov: Hi Dmitry, > >All input devices add randomness, however I think for mouse >add_input_randomness() will drop majority of events since they are >likely have the same value (well, depends on which direction you are >moving the

[PATCH 2/8] crypto: rsa - check status returned from crypto_unregister_akcipher

2015-09-09 Thread Tadeusz Struk
Add status check returned from crypto_unregister_akcipher function. Signed-off-by: Tadeusz Struk --- crypto/rsa.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/rsa.c b/crypto/rsa.c index 466003e..93feae2 100644 --- a/crypto/rsa.c +++

[PATCH 3/8] crypto: qat - check status returned from crypto_unregister_akcipher

2015-09-09 Thread Tadeusz Struk
Add status check returned from crypto_unregister_akcipher. Signed-off-by: Tadeusz Struk --- drivers/crypto/qat/qat_common/adf_common_drv.h |2 +- drivers/crypto/qat/qat_common/adf_init.c |6 ++ drivers/crypto/qat/qat_common/qat_asym_algs.c |7

[PATCH 1/8] crypto: akcipher - return status from crypto_unregister_alg

2015-09-09 Thread Tadeusz Struk
Return status from crypto_unregister_alg to the caller. Signed-off-by: Tadeusz Struk --- crypto/akcipher.c |4 ++-- include/crypto/internal/akcipher.h |4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crypto/akcipher.c

[PATCH 4/8] crypto: akcipher - Changes to asymmetric key API

2015-09-09 Thread Tadeusz Struk
Setkey function has been split into set_priv_key and set_pub_key. Akcipher requests takes sgl for src and dst instead of void *. Users of the API need to be disabled so that the build works fine after this patch. They will be enabled in subsequent patches. Signed-off-by: Tadeusz Struk

[PATCH 5/8] lib/scatterlist: Add sg_len helper

2015-09-09 Thread Tadeusz Struk
Add sg_len function which returns the total number of bytes in sg. Signed-off-by: Tadeusz Struk --- include/linux/scatterlist.h |1 + lib/scatterlist.c | 18 ++ 2 files changed, 19 insertions(+) diff --git a/include/linux/scatterlist.h

[PATCH 0/8] crypto: Updates to akcipher API

2015-09-09 Thread Tadeusz Struk
This series introduce updates to the akcipher API. setkey function has been split into set_pub_key and set_priv_key. Input and output buffers are now sgl instread of void * It also includes some minor updates like status check from crypto_unregister_akcipher which was not checked before. ---

Re: [PATCH 4/8] crypto: akcipher - Changes to asymmetric key API

2015-09-09 Thread Stephan Mueller
Am Mittwoch, 9. September 2015, 09:15:20 schrieb Tadeusz Struk: Hi Tadeusz, >Setkey function has been split into set_priv_key and set_pub_key. >Akcipher requests takes sgl for src and dst instead of void *. >Users of the API need to be disabled so that the build works fine >after this patch.

[PATCH 8/8] crypto: testmgr - update test mgr according to API changes

2015-09-09 Thread Tadeusz Struk
Signed-off-by: Tadeusz Struk --- crypto/testmgr.c | 44 +--- crypto/testmgr.h | 36 +++- 2 files changed, 48 insertions(+), 32 deletions(-) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index

[PATCH 6/8] crypto: rsa - update accoring to akcipher API changes

2015-09-09 Thread Tadeusz Struk
Rsa updates to reflect the API changes. Signed-off-by: Tadeusz Struk --- crypto/Makefile | 12 ++- crypto/rsa.c | 188 ++--- crypto/rsa_helper.c | 42 - crypto/rsakey.asn1

[PATCH 7/8] crypto: qat - update accoring to akcipher API changes

2015-09-09 Thread Tadeusz Struk
QAT updates to reflect akcipher API changes. Signed-off-by: Tadeusz Struk --- drivers/crypto/qat/qat_common/Makefile| 12 + drivers/crypto/qat/qat_common/qat_asym_algs.c | 225 +++-- drivers/crypto/qat/qat_common/qat_rsakey.asn1 |

Re: [PATCH 4/8] crypto: akcipher - Changes to asymmetric key API

2015-09-09 Thread Tadeusz Struk
Hi Stephan, On 09/09/2015 09:25 AM, Stephan Mueller wrote: >> >+#if 0 >> > static int do_test_rsa(struct crypto_akcipher *tfm, >> > struct akcipher_testvec *vecs) >> > { >> >@@ -1975,6 +1976,7 @@ static int alg_test_akcipher(const struct >> >alg_test_desc >> >*desc,

Contact Us For Unsecured Guaranteed Loans Today!!!?

2015-09-09 Thread Guaranteed
Do you need a genuine Loan to settle your bills and start up a good business? Kindly contact us now with your details to get a good Loan at a low rate of 3% per Annu, Quick send your details via: guarloa...@gmail.com -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the

Re: [PATCH 4/8] crypto: akcipher - Changes to asymmetric key API

2015-09-09 Thread Stephan Mueller
Am Mittwoch, 9. September 2015, 20:53:23 schrieb Andrzej Zaborowski: Hi Andrzej, > >Also a question regarding .get_len: for RSA with padding the minimum >dest buffer length depends on the input. What is that call supposed >to return in that case? I would guess that the destination buffer

Re: [PATCH 4/8] crypto: akcipher - Changes to asymmetric key API

2015-09-09 Thread Tadeusz Struk
On 09/09/2015 09:41 AM, Stephan Mueller wrote: >> >It is BER (Basic Encoding Rules), which is also valid DER (Distinguished >> >Encoding Rules) > I was just mentioning that since the ASN.1 structure now is equivalent to > OpenSSL and what DER specifies. I just wanted to suggest to allow readers

Re: [PATCH 5/8] lib/scatterlist: Add sg_len helper

2015-09-09 Thread Stephan Mueller
Am Mittwoch, 9. September 2015, 09:51:40 schrieb Tadeusz Struk: Hi Tadeusz, >On 09/09/2015 09:49 AM, Stephan Mueller wrote: >> But, shouldn't there be an overflow check? Maybe not here, but in the >> cases >> where the function is invoked. There is a kmalloc(src_len) without a

Re: [PATCH 5/8] lib/scatterlist: Add sg_len helper

2015-09-09 Thread Stephan Mueller
Am Mittwoch, 9. September 2015, 10:02:17 schrieb Tadeusz Struk: Hi Tadeusz, >On 09/09/2015 09:56 AM, Stephan Mueller wrote: But in the rsa.c enc/dec/verify/sign functions, there should be such check, >> I would guess. >>> > >>> >There is see line 419: >>> >return pkey->n ?

Re: [PATCH 4/8] crypto: akcipher - Changes to asymmetric key API

2015-09-09 Thread Andrzej Zaborowski
Hi, On 9 September 2015 at 18:41, Stephan Mueller wrote: > Am Mittwoch, 9. September 2015, 09:29:28 schrieb Tadeusz Struk: + * @key: BER encoded public key >>> >>> DER encoded? >> >>It is BER (Basic Encoding Rules), which is also valid DER (Distinguished >>Encoding

Re: [PATCH 6/8] crypto: rsa - update accoring to akcipher API changes

2015-09-09 Thread Stephan Mueller
Am Mittwoch, 9. September 2015, 09:15:32 schrieb Tadeusz Struk: Hi Tadeusz, >Rsa updates to reflect the API changes. > >Signed-off-by: Tadeusz Struk >--- > crypto/Makefile | 12 ++- > crypto/rsa.c | 188

Re: [PATCH 5/8] lib/scatterlist: Add sg_len helper

2015-09-09 Thread Stephan Mueller
Am Mittwoch, 9. September 2015, 09:31:00 schrieb Tadeusz Struk: Hi Tadeusz, >On 09/09/2015 09:27 AM, Stephan Mueller wrote: >>> +int sg_len(struct scatterlist *sg) >> >> unsigned int? > >No, because it can return -EINVAL if you call it before you set the key. I see. But, shouldn't there be an

Re: [PATCH 5/8] lib/scatterlist: Add sg_len helper

2015-09-09 Thread Tadeusz Struk
On 09/09/2015 09:39 AM, Stephan Mueller wrote: >> No, because it can return -EINVAL if you call it before you set the key. > I see. > > But, shouldn't there be an overflow check? Maybe not here, but in the cases > where the function is invoked. There is a kmalloc(src_len) without a check > for

Re: [PATCH 5/8] lib/scatterlist: Add sg_len helper

2015-09-09 Thread Tadeusz Struk
On 09/09/2015 09:56 AM, Stephan Mueller wrote: >>> But in the rsa.c enc/dec/verify/sign functions, there should be such check, >>> >> I would guess. >> > >> >There is see line 419: >> >return pkey->n ? mpi_get_size(pkey->n) : -EINVAL; > I feel we are not talking about the same issue. I refer to

Re: [PATCH 5/8] lib/scatterlist: Add sg_len helper

2015-09-09 Thread Tadeusz Struk
On 09/09/2015 09:49 AM, Stephan Mueller wrote: >>> >> But, shouldn't there be an overflow check? Maybe not here, but in the >>> >> cases >>> >> where the function is invoked. There is a kmalloc(src_len) without a >>> >> check >>> >> for negative values. >> > >> >Right, but because testmgr.c

Re: [PATCH 5/8] lib/scatterlist: Add sg_len helper

2015-09-09 Thread Stephan Mueller
Am Mittwoch, 9. September 2015, 10:16:16 schrieb Tadeusz Struk: Hi Tadeusz, >On 09/09/2015 10:05 AM, Stephan Mueller wrote: >>> Yes, sorry, you are right. sg_len() will only return positive numbers or >>> >>> >zero. rsa.c checks it in all four operations: >>> >if (unlikely(!pkey->n || !pkey->d

Re: [PATCH 5/8] lib/scatterlist: Add sg_len helper

2015-09-09 Thread Tadeusz Struk
On 09/09/2015 09:27 AM, Stephan Mueller wrote: >> +int sg_len(struct scatterlist *sg) > unsigned int? No, because it can return -EINVAL if you call it before you set the key. -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to

Re: [PATCH 5/8] lib/scatterlist: Add sg_len helper

2015-09-09 Thread Stephan Mueller
Am Mittwoch, 9. September 2015, 09:46:36 schrieb Tadeusz Struk: Hi Tadeusz, >On 09/09/2015 09:39 AM, Stephan Mueller wrote: >>> No, because it can return -EINVAL if you call it before you set the key. >> >> I see. >> >> But, shouldn't there be an overflow check? Maybe not here, but in the

Re: [PATCH 5/8] lib/scatterlist: Add sg_len helper

2015-09-09 Thread Stephan Mueller
Am Mittwoch, 9. September 2015, 09:31:00 schrieb Tadeusz Struk: Hi Tadeusz, >On 09/09/2015 09:27 AM, Stephan Mueller wrote: >>> +int sg_len(struct scatterlist *sg) >> >> unsigned int? > >No, because it can return -EINVAL if you call it before you set the key. Just re-reading the code: where

Re: [PATCH 6/8] crypto: rsa - update accoring to akcipher API changes

2015-09-09 Thread Tadeusz Struk
On 09/09/2015 09:35 AM, Stephan Mueller wrote: >> +if (sg_is_last(req->dst)) { >> >+ ret = mpi_read_buffer(c, sg_virt(req->dst), dst_len, >> >+ >out_len, ); >> >+ } else { >> >+ void *ptr = kmalloc(dst_len, GFP_KERNEL); >> >+ >> >+