[LTP] 答复: [PATCH] add several hash algorithms for crypto/crypto_user02.c

wenyehai wenyehai@huawei.com
Mon Jan 10 04:59:39 CET 2022


Hi Eric:



Thank you very much for your kind reply, and I am very sorry for not describing the background clearly.



Actually, I wanted to test the sha3 algorithm in kernel 5.10, but crypto_user02.c return "no viable algorithm found" as follows:



[cid:image001.png@01D80618.14306F90]



So I add sha3 to crypto_user02.c and run again, at the same time, according to the latest linux kernel encryption module, add several hash algorithms, as follows:



[cid:image002.png@01D80618.F702D790]







Best Regards

Yehai Wen







-----邮件原件-----

发件人: Eric Biggers [mailto:ebiggers@kernel.org]

发送时间: 2022年1月5日 23:14

收件人: wenyehai <wenyehai@huawei.com>

抄送: ltp@lists.linux.it

主题: Re: [LTP] [PATCH] add several hash algorithms for crypto/crypto_user02.c



On Tue, Jan 04, 2022 at 05:15:29PM +0800, wenyehai via ltp wrote:

> kernel/crypto/crypto_user02.c: add several hash algorithms according

> to the latest linux kernel encryption module

>

> Signed-off-by: Yehai Wen <wenyehai@huawei.com>

> ---

>  testcases/kernel/crypto/crypto_user02.c | 10 +++++++++-

>  1 file changed, 9 insertions(+), 1 deletion(-)

>

> diff --git a/testcases/kernel/crypto/crypto_user02.c

> b/testcases/kernel/crypto/crypto_user02.c

> index 717b297..afaff5d 100644

> --- a/testcases/kernel/crypto/crypto_user02.c

> +++ b/testcases/kernel/crypto/crypto_user02.c

> @@ -40,7 +40,15 @@ static const char * const ALGORITHM_CANDIDATES[] = {

>    "hmac(sha256-generic)",

>    "hmac(sha384-generic)",

>    "hmac(md5-generic)",

> -     "hmac(sm3-generic)"

> +    "hmac(sm3-generic)",

> +    "hmac(sha512-generic)",

> +    "hmac(rmd160-generic)",

> +    "hmac(sha3-224-generic)",

> +    "hmac(sha3-256-generic)",

> +    "hmac(sha3-384-generic)",

> +    "hmac(sha3-512-generic)",

> +    "hmac(streebog256-generic)",

> +    "hmac(streebog512-generic)"

>  };



There's no harm in listing more algorithms here.  Just to avoid any misunderstanding though, are you expecting this test to test those algorithms?

This test just uses the first available algorithm listed; it's a regression test for a bug in the crypto_user API, and not a test for the algorithms themselves.

So, listing more algorithms here doesn't magically provide test coverage for them.  If what you're looking for is an LTP test that tests that certain algorithms are working correctly, then such a test would need to be written.



- Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220110/78b178f7/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 8768 bytes
Desc: image001.png
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220110/78b178f7/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 31414 bytes
Desc: image002.png
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220110/78b178f7/attachment-0003.png>


More information about the ltp mailing list