diff mbox series

[v2] crypto: sun4i-ss - Fix sparse endianness markers

Message ID 20200908050036.GA19817@gondor.apana.org.au (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series [v2] crypto: sun4i-ss - Fix sparse endianness markers | expand

Commit Message

Herbert Xu Sept. 8, 2020, 5 a.m. UTC
On Mon, Sep 07, 2020 at 06:00:29PM +0200, Corentin Labbe wrote:
>
> The put_unaligned should be _le32.
> 
> This fix the modprobe tcrypt fail.

Thanks.  Yes the original code was correct.

---8<---
This patch also fixes the incorrect endianness markings in the
sun4i-ss driver.  It should have no effect in the genereated code.

Instead of using cpu_to_Xe32 followed by a memcpy, this patch
converts the final hash write to use put_unaligned_X instead.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Comments

Corentin Labbe Sept. 10, 2020, 12:22 p.m. UTC | #1
On Tue, Sep 08, 2020 at 03:00:36PM +1000, Herbert Xu wrote:
> On Mon, Sep 07, 2020 at 06:00:29PM +0200, Corentin Labbe wrote:
> >
> > The put_unaligned should be _le32.
> > 
> > This fix the modprobe tcrypt fail.
> 
> Thanks.  Yes the original code was correct.
> 
> ---8<---
> This patch also fixes the incorrect endianness markings in the
> sun4i-ss driver.  It should have no effect in the genereated code.
> 
> Instead of using cpu_to_Xe32 followed by a memcpy, this patch
> converts the final hash write to use put_unaligned_X instead.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> 
> diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c
> index dc35edd90034..1dff48558f53 100644
> --- a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c
> +++ b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c
> @@ -9,6 +9,7 @@
>   * You could find the datasheet in Documentation/arm/sunxi.rst
>   */
>  #include "sun4i-ss.h"
> +#include <asm/unaligned.h>
>  #include <linux/scatterlist.h>
>  
>  /* This is a totally arbitrary value */
> @@ -196,7 +197,7 @@ static int sun4i_hash(struct ahash_request *areq)
>  	struct sg_mapping_iter mi;
>  	int in_r, err = 0;
>  	size_t copied = 0;
> -	__le32 wb = 0;
> +	u32 wb = 0;
>  
>  	dev_dbg(ss->dev, "%s %s bc=%llu len=%u mode=%x wl=%u h0=%0x",
>  		__func__, crypto_tfm_alg_name(areq->base.tfm),
> @@ -408,7 +409,7 @@ static int sun4i_hash(struct ahash_request *areq)
>  
>  		nbw = op->len - 4 * nwait;
>  		if (nbw) {
> -			wb = cpu_to_le32(*(u32 *)(op->buf + nwait * 4));
> +			wb = le32_to_cpup((__le32 *)(op->buf + nwait * 4));
>  			wb &= GENMASK((nbw * 8) - 1, 0);
>  
>  			op->byte_count += nbw;
> @@ -417,7 +418,7 @@ static int sun4i_hash(struct ahash_request *areq)
>  
>  	/* write the remaining bytes of the nbw buffer */
>  	wb |= ((1 << 7) << (nbw * 8));
> -	bf[j++] = le32_to_cpu(wb);
> +	((__le32 *)bf)[j++] = cpu_to_le32(wb);
>  
>  	/*
>  	 * number of space to pad to obtain 64o minus 8(size) minus 4 (final 1)
> @@ -479,16 +480,16 @@ static int sun4i_hash(struct ahash_request *areq)
>  	/* Get the hash from the device */
>  	if (op->mode == SS_OP_SHA1) {
>  		for (i = 0; i < 5; i++) {
> +			v = readl(ss->base + SS_MD0 + i * 4);
>  			if (ss->variant->sha1_in_be)
> -				v = cpu_to_le32(readl(ss->base + SS_MD0 + i * 4));
> +				put_unaligned_le32(v, areq->result + i * 4);
>  			else
> -				v = cpu_to_be32(readl(ss->base + SS_MD0 + i * 4));
> -			memcpy(areq->result + i * 4, &v, 4);
> +				put_unaligned_be32(v, areq->result + i * 4);
>  		}
>  	} else {
>  		for (i = 0; i < 4; i++) {
> -			v = cpu_to_le32(readl(ss->base + SS_MD0 + i * 4));
> -			memcpy(areq->result + i * 4, &v, 4);
> +			v = readl(ss->base + SS_MD0 + i * 4);
> +			put_unaligned_le32(v, areq->result + i * 4);
>  		}
>  	}
>  

I get some md5 error on both A20+BE:
alg: ahash: md5 test failed (wrong result) on test vector \"random: psize=129 ksize=0\", cfg=\"random: inplace use_finup nosimd src_divs=[<reimport,nosimd>85.99%@+3999, 5.85%@+30, <reimport>0.96%@+25, <reimport,nosimd>5.9%@+2263, <flush,nosimd>2.11%@+1950] iv_offset=2 key_offset=43\"
and A33+BE:
[   84.469045] alg: ahash: md5 test failed (wrong result) on test vector \"random: psize=322 ksize=0\", cfg=\"random: inplace may_sleep use_finup src_divs=[<reimport>99.1%@+2668, <reimport>0.88%@alignmask+3630, 0.11%@+3403] iv_offset=33\"
+[   84.469074] need:35966fc8 b31ea266 2bf064e9 f20f40ad
+[   84.469084] have:e29e4491 f3b6effc fa366691 00e04bd9

Thoses errors are random. (1 boot out of 2)

The ahash-md5-sun4i-ss is set as "selftest: passed" and I didnt see any failling/absent test in /proc/crypto
So what is this md5 which fail ?

I am still investigating and will try on more platform.
Herbert Xu Sept. 11, 2020, 4:13 a.m. UTC | #2
On Thu, Sep 10, 2020 at 02:22:48PM +0200, Corentin Labbe wrote:
>
> I get some md5 error on both A20+BE:
> alg: ahash: md5 test failed (wrong result) on test vector \"random: psize=129 ksize=0\", cfg=\"random: inplace use_finup nosimd src_divs=[<reimport,nosimd>85.99%@+3999, 5.85%@+30, <reimport>0.96%@+25, <reimport,nosimd>5.9%@+2263, <flush,nosimd>2.11%@+1950] iv_offset=2 key_offset=43\"
> and A33+BE:
> [   84.469045] alg: ahash: md5 test failed (wrong result) on test vector \"random: psize=322 ksize=0\", cfg=\"random: inplace may_sleep use_finup src_divs=[<reimport>99.1%@+2668, <reimport>0.88%@alignmask+3630, 0.11%@+3403] iv_offset=33\"
> +[   84.469074] need:35966fc8 b31ea266 2bf064e9 f20f40ad
> +[   84.469084] have:e29e4491 f3b6effc fa366691 00e04bd9
> 
> Thoses errors are random. (1 boot out of 2)

Do these really go away without this patch applied? AFAICS the
generated code should be identical.

Thanks,
Corentin Labbe Sept. 14, 2020, 7:45 a.m. UTC | #3
On Fri, Sep 11, 2020 at 02:13:55PM +1000, Herbert Xu wrote:
> On Thu, Sep 10, 2020 at 02:22:48PM +0200, Corentin Labbe wrote:
> >
> > I get some md5 error on both A20+BE:
> > alg: ahash: md5 test failed (wrong result) on test vector \"random: psize=129 ksize=0\", cfg=\"random: inplace use_finup nosimd src_divs=[<reimport,nosimd>85.99%@+3999, 5.85%@+30, <reimport>0.96%@+25, <reimport,nosimd>5.9%@+2263, <flush,nosimd>2.11%@+1950] iv_offset=2 key_offset=43\"
> > and A33+BE:
> > [   84.469045] alg: ahash: md5 test failed (wrong result) on test vector \"random: psize=322 ksize=0\", cfg=\"random: inplace may_sleep use_finup src_divs=[<reimport>99.1%@+2668, <reimport>0.88%@alignmask+3630, 0.11%@+3403] iv_offset=33\"
> > +[   84.469074] need:35966fc8 b31ea266 2bf064e9 f20f40ad
> > +[   84.469084] have:e29e4491 f3b6effc fa366691 00e04bd9
> > 
> > Thoses errors are random. (1 boot out of 2)
> 
> Do these really go away without this patch applied? AFAICS the
> generated code should be identical.
> 

It happens without your patch, so your patch is unrelated to this issue.
You can add:
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Corentin Labbe Sept. 14, 2020, 10:40 a.m. UTC | #4
On Fri, Sep 11, 2020 at 02:13:55PM +1000, Herbert Xu wrote:
> On Thu, Sep 10, 2020 at 02:22:48PM +0200, Corentin Labbe wrote:
> >
> > I get some md5 error on both A20+BE:
> > alg: ahash: md5 test failed (wrong result) on test vector \"random: psize=129 ksize=0\", cfg=\"random: inplace use_finup nosimd src_divs=[<reimport,nosimd>85.99%@+3999, 5.85%@+30, <reimport>0.96%@+25, <reimport,nosimd>5.9%@+2263, <flush,nosimd>2.11%@+1950] iv_offset=2 key_offset=43\"
> > and A33+BE:
> > [   84.469045] alg: ahash: md5 test failed (wrong result) on test vector \"random: psize=322 ksize=0\", cfg=\"random: inplace may_sleep use_finup src_divs=[<reimport>99.1%@+2668, <reimport>0.88%@alignmask+3630, 0.11%@+3403] iv_offset=33\"
> > +[   84.469074] need:35966fc8 b31ea266 2bf064e9 f20f40ad
> > +[   84.469084] have:e29e4491 f3b6effc fa366691 00e04bd9
> > 
> > Thoses errors are random. (1 boot out of 2)
> 
> Do these really go away without this patch applied? AFAICS the
> generated code should be identical.
> 

I got this on next-20200910/multi_v7_defconfig BigEndian
[   12.137856] alg: hash: skipping comparison tests for md5-sun4i-ss because md5-generic is unavailable
md5-sun4i-ss md5 reqs=763
[   98.286632] alg: ahash: md5 test failed (wrong result) on test vector \"random: psize=65 ksize=0\", cfg=\"random: use_finup src_divs=[95.28%@+1052, <reimport>0.61%@+4046, 0.87%@+24, <reimport,nosimd>3.24%@+542] key_offset=54\"

So sun4i-ss is not involved.
Strangely /proc/crypto show:
name         : md5                                                                                  
driver       : md5-generic                                                                          
module       : md5                                                                                  
priority     : 0                                                                                    
refcnt       : 1                                                                                    
selftest     : passed                                                                               
internal     : no                                                                                   
type         : shash                                                                                
blocksize    : 64                                                                                   
digestsize   : 16

and I didnt see anything failed/unknow in /proc/crypto

Why the failed algorithm is not visible ?
Herbert Xu Sept. 24, 2020, 3:08 a.m. UTC | #5
On Mon, Sep 14, 2020 at 12:40:58PM +0200, Corentin Labbe wrote:
>
> I got this on next-20200910/multi_v7_defconfig BigEndian
> [   12.137856] alg: hash: skipping comparison tests for md5-sun4i-ss because md5-generic is unavailable
> md5-sun4i-ss md5 reqs=763
> [   98.286632] alg: ahash: md5 test failed (wrong result) on test vector \"random: psize=65 ksize=0\", cfg=\"random: use_finup src_divs=[95.28%@+1052, <reimport>0.61%@+4046, 0.87%@+24, <reimport,nosimd>3.24%@+542] key_offset=54\"
> 
> So sun4i-ss is not involved.
> Strangely /proc/crypto show:
> name         : md5                                                                                  
> driver       : md5-generic                                                                          
> module       : md5                                                                                  
> priority     : 0                                                                                    
> refcnt       : 1                                                                                    
> selftest     : passed                                                                               
> internal     : no                                                                                   
> type         : shash                                                                                
> blocksize    : 64                                                                                   
> digestsize   : 16
> 
> and I didnt see anything failed/unknow in /proc/crypto
> 
> Why the failed algorithm is not visible ?

Please include the complete /proc/crypto after you get the error.

Thanks,
Corentin Labbe Sept. 24, 2020, 1:27 p.m. UTC | #6
On Thu, Sep 24, 2020 at 01:08:59PM +1000, Herbert Xu wrote:
> On Mon, Sep 14, 2020 at 12:40:58PM +0200, Corentin Labbe wrote:
> >
> > I got this on next-20200910/multi_v7_defconfig BigEndian
> > [   12.137856] alg: hash: skipping comparison tests for md5-sun4i-ss because md5-generic is unavailable
> > md5-sun4i-ss md5 reqs=763
> > [   98.286632] alg: ahash: md5 test failed (wrong result) on test vector \"random: psize=65 ksize=0\", cfg=\"random: use_finup src_divs=[95.28%@+1052, <reimport>0.61%@+4046, 0.87%@+24, <reimport,nosimd>3.24%@+542] key_offset=54\"
> > 
> > So sun4i-ss is not involved.
> > Strangely /proc/crypto show:
> > name         : md5                                                                                  
> > driver       : md5-generic                                                                          
> > module       : md5                                                                                  
> > priority     : 0                                                                                    
> > refcnt       : 1                                                                                    
> > selftest     : passed                                                                               
> > internal     : no                                                                                   
> > type         : shash                                                                                
> > blocksize    : 64                                                                                   
> > digestsize   : 16
> > 
> > and I didnt see anything failed/unknow in /proc/crypto
> > 
> > Why the failed algorithm is not visible ?
> 
> Please include the complete /proc/crypto after you get the error.
> 

Hello

This is an example on next-20200923+BigEndian
alg: ahash: sha1 test failed (wrong result) on test vector \"random: psize=194 ksize=0\", cfg=\"random: inplace may_sleep use_finup src_divs=[98.25%@+1124, <flush>1.75%@+5] iv_offset=18\"

=== DUMP /proc/crypto ===
name         : ctr(sm4)
driver       : ctr(sm4-generic)
module       : ctr
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 16
max keysize  : 16
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : cbc(sm4)
driver       : cbc(sm4-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 16
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : ecb(sm4)
driver       : ecb(sm4-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 16
ivsize       : 0
chunksize    : 16
walksize     : 16
name         : sm4
driver       : sm4-generic
module       : sm4_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 16
min keysize  : 16
max keysize  : 16
name         : authenc(hmac(sha512),cbc(des3_ede))
driver       : authenc(hmac(sha512-generic),cbc(des3_ede-generic))
module       : authenc
priority     : 1100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 64
geniv        : <none>
name         : authenc(hmac(sha512),cbc(des3_ede))
driver       : authenc(hmac(sha512-generic),cbc-des3-sun4i-ss)
module       : authenc
priority     : 3100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 64
geniv        : <none>
name         : authenc(hmac(sha512),cbc(des))
driver       : authenc(hmac(sha512-generic),cbc(des-generic))
module       : authenc
priority     : 1100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 64
geniv        : <none>
name         : authenc(hmac(sha512),cbc(des))
driver       : authenc(hmac(sha512-generic),cbc-des-sun4i-ss)
module       : authenc
priority     : 3100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 64
geniv        : <none>
name         : authenc(hmac(sha384),cbc(des3_ede))
driver       : authenc(hmac(sha384-generic),cbc(des3_ede-generic))
module       : authenc
priority     : 1100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 48
geniv        : <none>
name         : authenc(hmac(sha384),cbc(des3_ede))
driver       : authenc(hmac(sha384-generic),cbc-des3-sun4i-ss)
module       : authenc
priority     : 3100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 48
geniv        : <none>
name         : authenc(hmac(sha384),cbc(des))
driver       : authenc(hmac(sha384-generic),cbc(des-generic))
module       : authenc
priority     : 1100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 48
geniv        : <none>
name         : authenc(hmac(sha384),cbc(des))
driver       : authenc(hmac(sha384-generic),cbc-des-sun4i-ss)
module       : authenc
priority     : 3100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 48
geniv        : <none>
name         : authenc(hmac(sha256),cbc(des3_ede))
driver       : authenc(hmac(sha256-generic),cbc(des3_ede-generic))
module       : authenc
priority     : 1100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 32
geniv        : <none>
name         : authenc(hmac(sha256),cbc(des3_ede))
driver       : authenc(hmac(sha256-generic),cbc-des3-sun4i-ss)
module       : authenc
priority     : 3100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 32
geniv        : <none>
name         : authenc(hmac(sha256),cbc(des))
driver       : authenc(hmac(sha256-generic),cbc(des-generic))
module       : authenc
priority     : 1100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 32
geniv        : <none>
name         : authenc(hmac(sha256),cbc(des))
driver       : authenc(hmac(sha256-generic),cbc-des-sun4i-ss)
module       : authenc
priority     : 3100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 32
geniv        : <none>
name         : authenc(hmac(sha224),cbc(des3_ede))
driver       : authenc(hmac(sha224-generic),cbc(des3_ede-generic))
module       : authenc
priority     : 1100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 28
geniv        : <none>
name         : authenc(hmac(sha224),cbc(des3_ede))
driver       : authenc(hmac(sha224-generic),cbc-des3-sun4i-ss)
module       : authenc
priority     : 3100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 28
geniv        : <none>
name         : authenc(hmac(sha224),cbc(des))
driver       : authenc(hmac(sha224-generic),cbc(des-generic))
module       : authenc
priority     : 1100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 28
geniv        : <none>
name         : authenc(hmac(sha224),cbc(des))
driver       : authenc(hmac(sha224-generic),cbc-des-sun4i-ss)
module       : authenc
priority     : 3100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 28
geniv        : <none>
name         : authenc(hmac(sha1),cbc(des3_ede))
driver       : authenc(hmac(sha1-generic),cbc(des3_ede-generic))
module       : authenc
priority     : 1100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 20
geniv        : <none>
name         : authenc(hmac(sha1),cbc(des3_ede))
driver       : authenc(hmac(sha1-generic),cbc-des3-sun4i-ss)
module       : authenc
priority     : 3100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 20
geniv        : <none>
name         : authenc(hmac(sha1),cbc(des))
driver       : authenc(hmac(sha1-generic),cbc(des-generic))
module       : authenc
priority     : 1100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 20
geniv        : <none>
name         : authenc(hmac(sha1),cbc(des))
driver       : authenc(hmac(sha1-generic),cbc-des-sun4i-ss)
module       : authenc
priority     : 3100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 8
ivsize       : 8
maxauthsize  : 20
geniv        : <none>
name         : authenc(hmac(sha1),ecb(cipher_null))
driver       : authenc(hmac(sha1-generic),ecb(cipher_null-generic))
module       : authenc
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 1
ivsize       : 0
maxauthsize  : 20
geniv        : <none>
name         : authenc(hmac(sha1),ecb(cipher_null))
driver       : authenc(hmac(sha1-generic),ecb-cipher_null)
module       : authenc
priority     : 1100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 1
ivsize       : 0
maxauthsize  : 20
geniv        : <none>
name         : authenc(hmac(md5),ecb(cipher_null))
driver       : authenc(hmac(md5-generic),ecb(cipher_null-generic))
module       : authenc
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 1
ivsize       : 0
maxauthsize  : 16
geniv        : <none>
name         : ecb(cipher_null)
driver       : ecb(cipher_null-generic)
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 0
max keysize  : 0
ivsize       : 0
chunksize    : 1
walksize     : 1
name         : authenc(hmac(md5),ecb(cipher_null))
driver       : authenc(hmac(md5-generic),ecb-cipher_null)
module       : authenc
priority     : 1000
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 1
ivsize       : 0
maxauthsize  : 16
geniv        : <none>
name         : authenc(hmac(sha1),cbc(aes))
driver       : authenc(hmac(sha1-generic),cbc(aes-generic))
module       : authenc
priority     : 1100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 16
ivsize       : 16
maxauthsize  : 20
geniv        : <none>
name         : authenc(hmac(sha1),cbc(aes))
driver       : authenc(hmac(sha1-generic),cbc-aes-sun4i-ss)
module       : authenc
priority     : 3100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 16
ivsize       : 16
maxauthsize  : 20
geniv        : <none>
name         : cmac(des3_ede)
driver       : cmac(des3_ede-generic)
module       : cmac
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 8
digestsize   : 8
name         : cmac(aes)
driver       : cmac(aes-generic)
module       : cmac
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 16
digestsize   : 16
name         : rfc4543(gcm(aes))
driver       : rfc4543(gcm_base(ctr(aes-generic),ghash-generic))
module       : gcm
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 1
ivsize       : 8
maxauthsize  : 16
geniv        : <none>
name         : rfc4106(gcm(aes))
driver       : rfc4106(gcm_base(ctr(aes-generic),ghash-generic))
module       : gcm
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 1
ivsize       : 8
maxauthsize  : 16
geniv        : <none>
name         : hmac(streebog512)
driver       : hmac(streebog512-generic)
module       : hmac
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 64
name         : hmac(streebog256)
driver       : hmac(streebog256-generic)
module       : hmac
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 32
name         : hmac(sha3-512)
driver       : hmac(sha3-512-generic)
module       : hmac
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 72
digestsize   : 64
name         : hmac(sha3-384)
driver       : hmac(sha3-384-generic)
module       : hmac
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 104
digestsize   : 48
name         : hmac(sha3-256)
driver       : hmac(sha3-256-generic)
module       : hmac
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 136
digestsize   : 32
name         : hmac(sha3-224)
driver       : hmac(sha3-224-generic)
module       : hmac
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 144
digestsize   : 28
name         : vmac64(aes)
driver       : vmac64(aes-generic)
module       : vmac
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 16
digestsize   : 8
name         : hmac(rmd160)
driver       : hmac(rmd160-generic)
module       : hmac
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 20
name         : hmac(rmd128)
driver       : hmac(rmd128-generic)
module       : hmac
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 16
name         : xcbc(aes)
driver       : xcbc(aes-generic)
module       : xcbc
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 16
digestsize   : 16
name         : hmac(sha224)
driver       : hmac(sha224-generic)
module       : hmac
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 28
name         : hmac(sha512)
driver       : hmac(sha512-generic)
module       : hmac
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 128
digestsize   : 64
name         : hmac(sha384)
driver       : hmac(sha384-generic)
module       : hmac
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 128
digestsize   : 48
name         : hmac(sha256)
driver       : hmac(sha256-generic)
module       : hmac
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 32
name         : hmac(sha1)
driver       : hmac(sha1-generic)
module       : hmac
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 20
name         : hmac(md5)
driver       : hmac(md5-generic)
module       : hmac
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 16
name         : streebog512
driver       : streebog512-generic
module       : streebog_generic
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 64
name         : streebog256
driver       : streebog256-generic
module       : streebog_generic
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 32
name         : sm3
driver       : sm3-generic
module       : sm3_generic
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 32
name         : sha3-512
driver       : sha3-512-generic
module       : sha3_generic
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 72
digestsize   : 64
name         : sha3-384
driver       : sha3-384-generic
module       : sha3_generic
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 104
digestsize   : 48
name         : sha3-256
driver       : sha3-256-generic
module       : sha3_generic
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 136
digestsize   : 32
name         : sha3-224
driver       : sha3-224-generic
module       : sha3_generic
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 144
digestsize   : 28
name         : crct10dif
driver       : crct10dif-generic
module       : crct10dif_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 1
digestsize   : 2
name         : rfc4309(ccm(aes))
driver       : rfc4309(ccm_base(ctr(aes-generic),cbcmac(aes-generic)))
module       : ccm
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 1
ivsize       : 8
maxauthsize  : 16
geniv        : <none>
name         : ecb(seed)
driver       : ecb(seed-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 16
ivsize       : 0
chunksize    : 16
walksize     : 16
name         : seed
driver       : seed-generic
module       : seed
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 16
min keysize  : 16
max keysize  : 16
name         : rmd320
driver       : rmd320-generic
module       : rmd320
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 40
name         : rmd256
driver       : rmd256-generic
module       : rmd256
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 32
name         : rmd160
driver       : rmd160-generic
module       : rmd160
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 20
name         : rmd128
driver       : rmd128-generic
module       : rmd128
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 16
name         : cts(cbc(aes))
driver       : cts(cbc(aes-generic))
module       : cts
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : cts(cbc(aes))
driver       : cts(cbc-aes-sun4i-ss)
module       : cts
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : ccm(aes)
driver       : ccm_base(ctr(aes-generic),cbcmac(aes-generic))
module       : ccm
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 1
ivsize       : 16
maxauthsize  : 16
geniv        : <none>
name         : cbcmac(aes)
driver       : cbcmac(aes-generic)
module       : ccm
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 1
digestsize   : 16
name         : lzo
driver       : lzo-scomp
module       : lzo
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : scomp
name         : lzo
driver       : lzo-generic
module       : lzo
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : compression
name         : gcm(aes)
driver       : gcm_base(ctr(aes-generic),ghash-generic)
module       : gcm
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : aead
async        : no
blocksize    : 1
ivsize       : 12
maxauthsize  : 16
geniv        : <none>
name         : ghash
driver       : ghash-generic
module       : ghash_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 16
digestsize   : 16
name         : salsa20
driver       : salsa20-generic
module       : salsa20_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 16
max keysize  : 32
ivsize       : 8
chunksize    : 64
walksize     : 64
name         : xts(camellia)
driver       : xts(ecb(camellia-generic))
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 32
max keysize  : 64
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : lrw(camellia)
driver       : lrw(ecb(camellia-generic))
module       : lrw
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 32
max keysize  : 48
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : ctr(camellia)
driver       : ctr(camellia-generic)
module       : ctr
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : cbc(camellia)
driver       : cbc(camellia-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : ecb(camellia)
driver       : ecb(camellia-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 0
chunksize    : 16
walksize     : 16
name         : camellia
driver       : camellia-generic
module       : camellia_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 16
min keysize  : 16
max keysize  : 32
name         : pcbc(fcrypt)
driver       : pcbc(fcrypt-generic)
module       : pcbc
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 8
max keysize  : 8
ivsize       : 8
chunksize    : 8
walksize     : 8
name         : fcrypt
driver       : fcrypt-generic
module       : fcrypt
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 8
min keysize  : 8
max keysize  : 8
name         : ecb(xeta)
driver       : ecb(xeta-generic)
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 16
max keysize  : 16
ivsize       : 0
chunksize    : 8
walksize     : 8
name         : tgr128
driver       : tgr128-generic
module       : tgr192
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 16
name         : tgr160
driver       : tgr160-generic
module       : tgr192
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 20
name         : tgr192
driver       : tgr192-generic
module       : tgr192
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 24
name         : cbc(anubis)
driver       : cbc(anubis-generic)
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 40
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : ecb(anubis)
driver       : ecb(anubis-generic)
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 40
ivsize       : 0
chunksize    : 16
walksize     : 16
name         : anubis
driver       : anubis-generic
module       : anubis
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 16
min keysize  : 16
max keysize  : 40
name         : ecb(tnepres)
driver       : ecb(tnepres-generic)
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 0
max keysize  : 32
ivsize       : 0
chunksize    : 16
walksize     : 16
name         : wp256
driver       : wp256-generic
module       : wp512
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 32
name         : wp384
driver       : wp384-generic
module       : wp512
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 48
name         : wp512
driver       : wp512-generic
module       : wp512
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 64
name         : ecb(khazad)
driver       : ecb(khazad-generic)
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 16
max keysize  : 16
ivsize       : 0
chunksize    : 8
walksize     : 8
name         : khazad
driver       : khazad-generic
module       : khazad
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 8
min keysize  : 16
max keysize  : 16
name         : ecb(xtea)
driver       : ecb(xtea-generic)
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 16
max keysize  : 16
ivsize       : 0
chunksize    : 8
walksize     : 8
name         : ecb(tea)
driver       : ecb(tea-generic)
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 16
max keysize  : 16
ivsize       : 0
chunksize    : 8
walksize     : 8
name         : xeta
driver       : xeta-generic
module       : tea
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 8
min keysize  : 16
max keysize  : 16
name         : xtea
driver       : xtea-generic
module       : tea
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 8
min keysize  : 16
max keysize  : 16
name         : tea
driver       : tea-generic
module       : tea
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 8
min keysize  : 16
max keysize  : 16
name         : michael_mic
driver       : michael_mic-generic
module       : michael_mic
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 8
digestsize   : 8
name         : ecb(arc4)
driver       : ecb(arc4)-generic
module       : arc4
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 1
max keysize  : 256
ivsize       : 0
chunksize    : 1
walksize     : 1
name         : xts(cast6)
driver       : xts(ecb(cast6-generic))
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 32
max keysize  : 64
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : lrw(cast6)
driver       : lrw(ecb(cast6-generic))
module       : lrw
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 32
max keysize  : 48
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : ctr(cast6)
driver       : ctr(cast6-generic)
module       : ctr
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : cbc(cast6)
driver       : cbc(cast6-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : ecb(cast6)
driver       : ecb(cast6-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 0
chunksize    : 16
walksize     : 16
name         : cast6
driver       : cast6-generic
module       : cast6_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 16
min keysize  : 16
max keysize  : 32
name         : ctr(cast5)
driver       : ctr(cast5-generic)
module       : ctr
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 5
max keysize  : 16
ivsize       : 8
chunksize    : 8
walksize     : 8
name         : cbc(cast5)
driver       : cbc(cast5-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 5
max keysize  : 16
ivsize       : 8
chunksize    : 8
walksize     : 8
name         : ecb(cast5)
driver       : ecb(cast5-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 5
max keysize  : 16
ivsize       : 0
chunksize    : 8
walksize     : 8
name         : cast5
driver       : cast5-generic
module       : cast5_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 8
min keysize  : 5
max keysize  : 16
name         : zlib-deflate
driver       : zlib-deflate-scomp
module       : deflate
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : scomp
name         : deflate
driver       : deflate-scomp
module       : deflate
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : scomp
name         : deflate
driver       : deflate-generic
module       : deflate
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : compression
name         : sha384
driver       : sha384-generic
module       : sha512_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 128
digestsize   : 48
name         : sha512
driver       : sha512-generic
module       : sha512_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 128
digestsize   : 64
name         : cfb(aes)
driver       : cfb(aes-generic)
module       : cfb
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : ofb(aes)
driver       : ofb(aes-generic)
module       : ofb
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : rfc3686(ctr(aes))
driver       : rfc3686(ctr(aes-generic))
module       : ctr
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 20
max keysize  : 36
ivsize       : 8
chunksize    : 16
walksize     : 16
name         : ctr(aes)
driver       : ctr(aes-generic)
module       : ctr
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : xts(aes)
driver       : xts(ecb(aes-generic))
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 32
max keysize  : 64
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : xts(aes)
driver       : xts(ecb-aes-sun4i-ss)
module       : kernel
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 32
max keysize  : 64
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : lrw(aes)
driver       : lrw(ecb(aes-generic))
module       : lrw
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 32
max keysize  : 48
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : lrw(aes)
driver       : lrw(ecb-aes-sun4i-ss)
module       : lrw
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 32
max keysize  : 48
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : xts(serpent)
driver       : xts(ecb(serpent-generic))
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 0
max keysize  : 64
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : lrw(serpent)
driver       : lrw(ecb(serpent-generic))
module       : lrw
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 48
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : ctr(serpent)
driver       : ctr(serpent-generic)
module       : ctr
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 0
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : cbc(serpent)
driver       : cbc(serpent-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 0
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : ecb(serpent)
driver       : ecb(serpent-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 0
max keysize  : 32
ivsize       : 0
chunksize    : 16
walksize     : 16
name         : tnepres
driver       : tnepres-generic
module       : serpent_generic
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 16
min keysize  : 0
max keysize  : 32
name         : serpent
driver       : serpent-generic
module       : serpent_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 16
min keysize  : 0
max keysize  : 32
name         : xts(twofish)
driver       : xts(ecb(twofish-generic))
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 32
max keysize  : 64
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : lrw(twofish)
driver       : lrw(ecb(twofish-generic))
module       : lrw
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 32
max keysize  : 48
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : ctr(twofish)
driver       : ctr(twofish-generic)
module       : ctr
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : cbc(twofish)
driver       : cbc(twofish-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : ecb(twofish)
driver       : ecb(twofish-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 0
chunksize    : 16
walksize     : 16
name         : twofish
driver       : twofish-generic
module       : twofish_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 16
min keysize  : 16
max keysize  : 32
name         : ctr(blowfish)
driver       : ctr(blowfish-generic)
module       : ctr
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 4
max keysize  : 56
ivsize       : 8
chunksize    : 8
walksize     : 8
name         : cbc(blowfish)
driver       : cbc(blowfish-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 4
max keysize  : 56
ivsize       : 8
chunksize    : 8
walksize     : 8
name         : ecb(blowfish)
driver       : ecb(blowfish-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 4
max keysize  : 56
ivsize       : 0
chunksize    : 8
walksize     : 8
name         : blowfish
driver       : blowfish-generic
module       : blowfish_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 8
min keysize  : 4
max keysize  : 56
name         : sha224
driver       : sha224-generic
module       : sha256_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 28
name         : sha256
driver       : sha256-generic
module       : sha256_generic
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 32
name         : md4
driver       : md4-generic
module       : md4
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 16
name         : ctr(des3_ede)
driver       : ctr(des3_ede-generic)
module       : ctr
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 24
max keysize  : 24
ivsize       : 8
chunksize    : 8
walksize     : 8
name         : ctr(des)
driver       : ctr(des-generic)
module       : ctr
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 8
max keysize  : 8
ivsize       : 8
chunksize    : 8
walksize     : 8
name         : stdrng
driver       : sun4i_ss_rng
module       : kernel
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : rng
seedsize     : 24
name         : ecb(des3_ede)
driver       : ecb(des3_ede-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 24
max keysize  : 24
ivsize       : 0
chunksize    : 8
walksize     : 8
name         : ecb(des3_ede)
driver       : ecb-des3-sun4i-ss
module       : kernel
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 24
max keysize  : 24
ivsize       : 0
chunksize    : 8
walksize     : 8
name         : cbc(des3_ede)
driver       : cbc(des3_ede-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 24
max keysize  : 24
ivsize       : 8
chunksize    : 8
walksize     : 8
name         : cbc(des3_ede)
driver       : cbc-des3-sun4i-ss
module       : kernel
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 24
max keysize  : 24
ivsize       : 8
chunksize    : 8
walksize     : 8
name         : ecb(des)
driver       : ecb(des-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 8
max keysize  : 8
ivsize       : 0
chunksize    : 8
walksize     : 8
name         : ecb(des)
driver       : ecb-des-sun4i-ss
module       : kernel
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 8
max keysize  : 8
ivsize       : 0
chunksize    : 8
walksize     : 8
name         : cbc(des)
driver       : cbc(des-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 8
max keysize  : 8
ivsize       : 8
chunksize    : 8
walksize     : 8
name         : cbc(des)
driver       : cbc-des-sun4i-ss
module       : kernel
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 8
min keysize  : 8
max keysize  : 8
ivsize       : 8
chunksize    : 8
walksize     : 8
name         : ecb(aes)
driver       : ecb(aes-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 0
chunksize    : 16
walksize     : 16
name         : ecb(aes)
driver       : ecb-aes-sun4i-ss
module       : kernel
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 0
chunksize    : 16
walksize     : 16
name         : cbc(aes)
driver       : cbc(aes-generic)
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : cbc(aes)
driver       : cbc-aes-sun4i-ss
module       : kernel
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 16
min keysize  : 16
max keysize  : 32
ivsize       : 16
chunksize    : 16
walksize     : 16
name         : sha1
driver       : sha1-sun4i-ss
module       : kernel
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : ahash
async        : no
blocksize    : 64
digestsize   : 20
name         : md5
driver       : md5-sun4i-ss
module       : kernel
priority     : 300
refcnt       : 1
selftest     : passed
internal     : no
type         : ahash
async        : no
blocksize    : 64
digestsize   : 16
name         : stdrng
driver       : ansi_cprng
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : rng
seedsize     : 48
name         : crc32c
driver       : crc32c-generic
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 1
digestsize   : 4
name         : aes
driver       : aes-generic
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 16
min keysize  : 16
max keysize  : 32
name         : des3_ede
driver       : des3_ede-generic
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 8
min keysize  : 24
max keysize  : 24
name         : des
driver       : des-generic
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 8
min keysize  : 8
max keysize  : 8
name         : sha1
driver       : sha1-generic
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 20
name         : md5
driver       : md5-generic
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 64
digestsize   : 16
name         : ecb(cipher_null)
driver       : ecb-cipher_null
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : skcipher
async        : no
blocksize    : 1
min keysize  : 0
max keysize  : 0
ivsize       : 0
chunksize    : 1
walksize     : 1
name         : digest_null
driver       : digest_null-generic
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 1
digestsize   : 0
name         : compress_null
driver       : compress_null-generic
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : compression
name         : cipher_null
driver       : cipher_null-generic
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
internal     : no
type         : cipher
blocksize    : 1
min keysize  : 0
max keysize  : 0
=== END DUMP ===
Herbert Xu Oct. 8, 2020, 5:52 a.m. UTC | #7
On Thu, Sep 24, 2020 at 03:27:38PM +0200, Corentin Labbe wrote:
>
> This is an example on next-20200923+BigEndian
> alg: ahash: sha1 test failed (wrong result) on test vector \"random: psize=194 ksize=0\", cfg=\"random: inplace may_sleep use_finup src_divs=[98.25%@+1124, <flush>1.75%@+5] iv_offset=18\"

Hmm, the only way I can see this happening is if it was triggered
by tcrypt.  Were you using tcrypt by any chance?

Ccing Eric in case he has any insight.

> === DUMP /proc/crypto ===
> name         : sha1
> driver       : sha1-sun4i-ss
> module       : kernel
> priority     : 300
> refcnt       : 1
> selftest     : passed
> internal     : no
> type         : ahash
> async        : no
> blocksize    : 64
> digestsize   : 20

...

> name         : sha1
> driver       : sha1-generic
> module       : kernel
> priority     : 100
> refcnt       : 1
> selftest     : passed
> internal     : no
> type         : shash
> blocksize    : 64
> digestsize   : 20

Thanks,
Corentin Labbe Oct. 8, 2020, 6:36 a.m. UTC | #8
On Thu, Oct 08, 2020 at 04:52:38PM +1100, Herbert Xu wrote:
> On Thu, Sep 24, 2020 at 03:27:38PM +0200, Corentin Labbe wrote:
> >
> > This is an example on next-20200923+BigEndian
> > alg: ahash: sha1 test failed (wrong result) on test vector \"random: psize=194 ksize=0\", cfg=\"random: inplace may_sleep use_finup src_divs=[98.25%@+1124, <flush>1.75%@+5] iv_offset=18\"
> 
> Hmm, the only way I can see this happening is if it was triggered
> by tcrypt.  Were you using tcrypt by any chance?
> 
> Ccing Eric in case he has any insight.
> 
> > === DUMP /proc/crypto ===
> > name         : sha1
> > driver       : sha1-sun4i-ss
> > module       : kernel
> > priority     : 300
> > refcnt       : 1
> > selftest     : passed
> > internal     : no
> > type         : ahash
> > async        : no
> > blocksize    : 64
> > digestsize   : 20
> 
> ...
> 
> > name         : sha1
> > driver       : sha1-generic
> > module       : kernel
> > priority     : 100
> > refcnt       : 1
> > selftest     : passed
> > internal     : no
> > type         : shash
> > blocksize    : 64
> > digestsize   : 20
> 
> Thanks,

Yes I use tcrypt to force all algos to be tested.
Eric Biggers Oct. 8, 2020, 11:35 p.m. UTC | #9
On Thu, Oct 08, 2020 at 08:36:23AM +0200, Corentin Labbe wrote:
> On Thu, Oct 08, 2020 at 04:52:38PM +1100, Herbert Xu wrote:
> > On Thu, Sep 24, 2020 at 03:27:38PM +0200, Corentin Labbe wrote:
> > >
> > > This is an example on next-20200923+BigEndian
> > > alg: ahash: sha1 test failed (wrong result) on test vector \"random: psize=194 ksize=0\", cfg=\"random: inplace may_sleep use_finup src_divs=[98.25%@+1124, <flush>1.75%@+5] iv_offset=18\"

This failure is in one of the randomly generated test cases.  If it doesn't
reproduce reliably, you can set cryptomgr.fuzz_iterations=1000 on the kernel
command line (increased from the default 100).

It is confusing that it says just "sha1".  This seems to be a quirk specific to
how tcrypt calls alg_test().  It's probably really testing "sha1-sun4i-ss".
I guess that testmgr.c should be using the actual cra_driver_name in the log
messages, not the 'driver' string that was passed into alg_test().

- Eric
diff mbox series

Patch

diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c
index dc35edd90034..1dff48558f53 100644
--- a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c
+++ b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c
@@ -9,6 +9,7 @@ 
  * You could find the datasheet in Documentation/arm/sunxi.rst
  */
 #include "sun4i-ss.h"
+#include <asm/unaligned.h>
 #include <linux/scatterlist.h>
 
 /* This is a totally arbitrary value */
@@ -196,7 +197,7 @@  static int sun4i_hash(struct ahash_request *areq)
 	struct sg_mapping_iter mi;
 	int in_r, err = 0;
 	size_t copied = 0;
-	__le32 wb = 0;
+	u32 wb = 0;
 
 	dev_dbg(ss->dev, "%s %s bc=%llu len=%u mode=%x wl=%u h0=%0x",
 		__func__, crypto_tfm_alg_name(areq->base.tfm),
@@ -408,7 +409,7 @@  static int sun4i_hash(struct ahash_request *areq)
 
 		nbw = op->len - 4 * nwait;
 		if (nbw) {
-			wb = cpu_to_le32(*(u32 *)(op->buf + nwait * 4));
+			wb = le32_to_cpup((__le32 *)(op->buf + nwait * 4));
 			wb &= GENMASK((nbw * 8) - 1, 0);
 
 			op->byte_count += nbw;
@@ -417,7 +418,7 @@  static int sun4i_hash(struct ahash_request *areq)
 
 	/* write the remaining bytes of the nbw buffer */
 	wb |= ((1 << 7) << (nbw * 8));
-	bf[j++] = le32_to_cpu(wb);
+	((__le32 *)bf)[j++] = cpu_to_le32(wb);
 
 	/*
 	 * number of space to pad to obtain 64o minus 8(size) minus 4 (final 1)
@@ -479,16 +480,16 @@  static int sun4i_hash(struct ahash_request *areq)
 	/* Get the hash from the device */
 	if (op->mode == SS_OP_SHA1) {
 		for (i = 0; i < 5; i++) {
+			v = readl(ss->base + SS_MD0 + i * 4);
 			if (ss->variant->sha1_in_be)
-				v = cpu_to_le32(readl(ss->base + SS_MD0 + i * 4));
+				put_unaligned_le32(v, areq->result + i * 4);
 			else
-				v = cpu_to_be32(readl(ss->base + SS_MD0 + i * 4));
-			memcpy(areq->result + i * 4, &v, 4);
+				put_unaligned_be32(v, areq->result + i * 4);
 		}
 	} else {
 		for (i = 0; i < 4; i++) {
-			v = cpu_to_le32(readl(ss->base + SS_MD0 + i * 4));
-			memcpy(areq->result + i * 4, &v, 4);
+			v = readl(ss->base + SS_MD0 + i * 4);
+			put_unaligned_le32(v, areq->result + i * 4);
 		}
 	}