[PATCH v3 4/4] crypto: testmgr - Add a test case for import()/export()

2016-02-03 Thread Rui Wang
Modify __test_hash() so that hash import/export can be tested from within the kernel. The test is unconditionally done when a struct hash_testvec has its .np > 1. v3: make the test unconditional v2: Leverage template[i].np as suggested by Tim Chen Signed-off-by: Rui Wang --- crypto/testmg

Re: [PATCH v2 4/4] crypto: testmgr - Add a test case for import()/export()

2016-02-02 Thread Rui Wang
On Tue, Feb 2, 2016 10:45 PM Herbert Xu wrote: > > On Tue, Feb 02, 2016 at 10:16:34PM +0800, Rui Wang wrote: > > > > I initially made it unconditional, but then I found that it can easily > > hang the machine during boot due to any import/export bug in any of > > th

Re: [PATCH v2 4/4] crypto: testmgr - Add a test case for import()/export()

2016-02-02 Thread Rui Wang
On Mon, Feb 1, 2016 4:22 PM Herbert Xu wrote: > > On Wed, Jan 27, 2016 at 05:08:38PM +0800, Rui Wang wrote: > > > > diff --git a/crypto/testmgr.h b/crypto/testmgr.h index > > da0a8fd..451e7eb 100644 > > --- a/crypto/testmgr.h > > +++ b/crypto/testmgr.h >

Re: [PATCH v2 1/4] crypto x86/sha1_mb: Fix load failure

2016-02-02 Thread Rui Wang
On Monday, February 1, 2016 4:18 PM, Herbert Xu wrote: > > On Wed, Jan 27, 2016 at 05:08:35PM +0800, Rui Wang wrote: >> >> +static int sha1_mb_async_import(struct ahash_request *req, const void >> +*in) { >> +struct ahash_request *mcryptd_req = ahash_re

[PATCH v2 2/4] crypto: mcryptd - Fix load failure

2016-01-27 Thread Rui Wang
mcryptd_create_hash() fails by returning -EINVAL, causing any driver using mcryptd to fail to load. It is because it needs to set its statesize properly. Signed-off-by: Rui Wang --- crypto/mcryptd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/mcryptd.c b/crypto/mcryptd.c index

[PATCH v2 3/4] crypto: algif_hash - wait for crypto_ahash_init() to complete

2016-01-27 Thread Rui Wang
hash_sendmsg/sendpage() need to wait for the completion of crypto_ahash_init() otherwise it can cause panic. Signed-off-by: Rui Wang --- crypto/algif_hash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c index b4c24fe..83dc095

[PATCH v2 4/4] crypto: testmgr - Add a test case for import()/export()

2016-01-27 Thread Rui Wang
Modify __test_hash() so that hash import/export can be tested from within the kernel by simply adding .partial = 1 to a hash algo's struct hash_testvec where .np > 1. v2: Leverage template[i].np as suggested by Tim Chen Signed-off-by: Rui Wang --- crypto/testmgr

[PATCH v2 1/4] crypto x86/sha1_mb: Fix load failure

2016-01-27 Thread Rui Wang
modprobe sha1_mb fails with the following message: modprobe: ERROR: could not insert 'sha1_mb': No such device It is because it needs to set its statesize and implement its import() and export() interface. Signed-off-by: Rui Wang --- arch/x86/crypto/sha-mb/sha1

[PATCH v2 0/4] Fix sha1_mb failure and testing import()/export()

2016-01-27 Thread Rui Wang
sha1_mb. patch04 adds a test case for import() and export(). A hash algo's import()/export() can be tested by simply adding .partial = 1 to its corresponding struct hash_testvec where .np > 1. v2: Leverage template[i].np in the test case as suggested by Tim Chen. Rui Wang (4): crypto x86

[PATCH 1/2] crypto: ghash-clmulni - Fix load failure

2015-11-29 Thread Rui Wang
rt()/export(), and must have a non- zero statesize. This patch has been tested with the algif_hash interface. The calculated digest values, after several rounds of import()s and export()s, match those calculated by tcrypt. Signed-off-by: Rui Wang --- arch/x86/crypto/ghash-clmulni-intel_glue.c | 26

[PATCH 2/2] crypto: cryptd - Assign statesize properly

2015-11-29 Thread Rui Wang
cryptd_create_hash() fails by returning -EINVAL. It is because after 8996eafdc ("crypto: ahash - ensure statesize is non-zero") all ahash drivers must have a non-zero statesize. This patch fixes the problem by properly assigning the statesize. Signed-off-by: Rui Wang --- crypto/cr

[PATCH 0/2] crypto: Fix driver load failure

2015-11-29 Thread Rui Wang
ghash_clmulni_intel fails to load on Linux 4.3+ with the following message: "modprobe: ERROR: could not insert 'ghash_clmulni_intel': Invalid argument" These two patches need to go together, for the driver to load correctly. Rui Wang (2): crypto: ghash-clmulni - Fix l