Commit 491cd062 authored by Horia Geantă's avatar Horia Geantă Committed by Greg Kroah-Hartman

crypto: tcrypt - fix ghash-generic speed test

commit 331351f89c36bf7d03561a28b6f64fa10a9f6f3a upstream.

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: <> # 4.6+
Fixes: 0660511c ("crypto: tcrypt - Use ahash")
Tested-by: 's avatarFranck Lenormand <>
Signed-off-by: 's avatarHoria Geantă <>
Acked-by: 's avatarArd Biesheuvel <>
Signed-off-by: 's avatarHerbert Xu <>
Signed-off-by: 's avatarGreg Kroah-Hartman <>
parent b957cd4d
......@@ -729,6 +729,9 @@ static void test_ahash_speed_common(const char *algo, unsigned int secs,
if (speed[i].klen)
crypto_ahash_setkey(tfm, tvmem[0], speed[i].klen);
pr_info("test%3u "
"(%5u byte blocks,%5u bytes per update,%4u updates): ",
i, speed[i].blen, speed[i].plen, speed[i].blen / speed[i].plen);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment