summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorHoria Geantă <horia.geanta@nxp.com>2018-09-12 09:20:48 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2018-09-21 01:24:51 -0400
commit331351f89c36bf7d03561a28b6f64fa10a9f6f3a (patch)
treef3a721e20e076f73268d21e9021f704f961651a2 /crypto
parente8342cc7954eaf26b6b1d451e7aa0e50b5b540e7 (diff)
crypto: tcrypt - fix ghash-generic speed test
ghash is a keyed hash algorithm, thus setkey needs to be called. Otherwise the following error occurs: $ modprobe tcrypt mode=318 sec=1 testing speed of async ghash-generic (ghash-generic) tcrypt: test 0 ( 16 byte blocks, 16 bytes per update, 1 updates): tcrypt: hashing failed ret=-126 Cc: <stable@vger.kernel.org> # 4.6+ Fixes: 0660511c0bee ("crypto: tcrypt - Use ahash") Tested-by: Franck Lenormand <franck.lenormand@nxp.com> Signed-off-by: Horia Geantă <horia.geanta@nxp.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/tcrypt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index bdde95e8d369..6e0a054bb61d 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -1103,6 +1103,9 @@ static void test_ahash_speed_common(const char *algo, unsigned int secs,
1103 break; 1103 break;
1104 } 1104 }
1105 1105
1106 if (speed[i].klen)
1107 crypto_ahash_setkey(tfm, tvmem[0], speed[i].klen);
1108
1106 pr_info("test%3u " 1109 pr_info("test%3u "
1107 "(%5u byte blocks,%5u bytes per update,%4u updates): ", 1110 "(%5u byte blocks,%5u bytes per update,%4u updates): ",
1108 i, speed[i].blen, speed[i].plen, speed[i].blen / speed[i].plen); 1111 i, speed[i].blen, speed[i].plen, speed[i].blen / speed[i].plen);