All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] add several hash algorithms for crypto/crypto_user02.c
@ 2022-01-04  9:15 wenyehai via ltp
  2022-01-05 15:13 ` Eric Biggers
  0 siblings, 1 reply; 7+ messages in thread
From: wenyehai via ltp @ 2022-01-04  9:15 UTC (permalink / raw)
  To: ltp; +Cc: wenyehai

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)"
 };

 static const char* algorithm = NULL;
--
2.7.4


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH] add several hash algorithms for crypto/crypto_user02.c
  2022-01-04  9:15 [LTP] [PATCH] add several hash algorithms for crypto/crypto_user02.c wenyehai via ltp
@ 2022-01-05 15:13 ` Eric Biggers
  2022-01-10  3:59   ` [LTP] 答复: " wenyehai via ltp
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Biggers @ 2022-01-05 15:13 UTC (permalink / raw)
  To: wenyehai; +Cc: ltp

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

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP] 答复:  [PATCH] add several hash algorithms for crypto/crypto_user02.c
  2022-01-05 15:13 ` Eric Biggers
@ 2022-01-10  3:59   ` wenyehai via ltp
  2022-01-10 17:44     ` Eric Biggers
  0 siblings, 1 reply; 7+ messages in thread
From: wenyehai via ltp @ 2022-01-10  3:59 UTC (permalink / raw)
  To: Eric Biggers; +Cc: ltp


[-- Attachment #1.1.1: Type: text/plain, Size: 2544 bytes --]

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

[-- Attachment #1.1.2: Type: text/html, Size: 9877 bytes --]

[-- Attachment #1.2: image001.png --]
[-- Type: image/png, Size: 8768 bytes --]

[-- Attachment #1.3: image002.png --]
[-- Type: image/png, Size: 31414 bytes --]

[-- Attachment #2: Type: text/plain, Size: 60 bytes --]


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP]  答复:  [PATCH] add several hash algorithms for crypto/crypto_user02.c
  2022-01-10  3:59   ` [LTP] 答复: " wenyehai via ltp
@ 2022-01-10 17:44     ` Eric Biggers
  2022-01-11  2:19       ` [LTP] 答复: " wenyehai via ltp
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Biggers @ 2022-01-10 17:44 UTC (permalink / raw)
  To: wenyehai; +Cc: ltp

On Mon, Jan 10, 2022 at 03:59:39AM +0000, wenyehai wrote:
> 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]

[For compatibility with the mailing list, please use plain text email without
images -- thanks!]

I still don't understand exactly what you're trying to do.  If you're just
trying to get crypto_user02 to run in more cases, then your patch makes sense.
If on the other hand you're actually trying to get the kernel to instantiate
more algorithms so that their in-kernel self-tests are run, that is *not* the
purpose of crypto_user02; a new test should be written for that purpose.  The
test could try to instantiate all algorithms which have in-kernel self-tests.

- Eric

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP] 答复: 答复:  [PATCH] add several hash algorithms for crypto/crypto_user02.c
  2022-01-10 17:44     ` Eric Biggers
@ 2022-01-11  2:19       ` wenyehai via ltp
  2022-01-11  3:03         ` Eric Biggers
  0 siblings, 1 reply; 7+ messages in thread
From: wenyehai via ltp @ 2022-01-11  2:19 UTC (permalink / raw)
  To: Eric Biggers; +Cc: ltp


Hi Eric:

Thank you very much for your kind reply, and also sorry for causing you confusion. 
Actually, I do want to get crypto_user02 to run in more cases.

The product which I tested just only enable sha3 algorithm, but when I run cryto_user02, it tells "no viable algorithm found", as follows:
./crypto_user02
tst_test.c:1365: TINFO: Timeout per run is 0h 05m 00s
crypto_user02.c:84: TCONF: No viable algorithm found

Summary:
passed   0
failed   0
broken   0
skipped  1
warnings 0


I want crypto_user02 to support more cases(not only sha3), but I am not sure which algorithms should list, 
so I compare with the latest linux kernel encryption module, add several hash algorithms which not list in crypto_user02.



Best Regards
Yehai Wen

-----邮件原件-----
发件人: Eric Biggers [mailto:ebiggers@kernel.org] 
发送时间: 2022年1月11日 1:44
收件人: wenyehai <wenyehai@huawei.com>
抄送: ltp@lists.linux.it
主题: Re: 答复: [LTP] [PATCH] add several hash algorithms for crypto/crypto_user02.c

On Mon, Jan 10, 2022 at 03:59:39AM +0000, wenyehai wrote:
> 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]

[For compatibility with the mailing list, please use plain text email without images -- thanks!]

I still don't understand exactly what you're trying to do.  If you're just trying to get crypto_user02 to run in more cases, then your patch makes sense.
If on the other hand you're actually trying to get the kernel to instantiate more algorithms so that their in-kernel self-tests are run, that is *not* the purpose of crypto_user02; a new test should be written for that purpose.  The test could try to instantiate all algorithms which have in-kernel self-tests.

- Eric

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP]  答复: 答复:  [PATCH] add several hash algorithms for crypto/crypto_user02.c
  2022-01-11  2:19       ` [LTP] 答复: " wenyehai via ltp
@ 2022-01-11  3:03         ` Eric Biggers
  2022-01-11  3:11           ` [LTP] 答复: " wenyehai via ltp
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Biggers @ 2022-01-11  3:03 UTC (permalink / raw)
  To: wenyehai; +Cc: ltp

On Tue, Jan 11, 2022 at 02:19:05AM +0000, wenyehai wrote:
> 
> Hi Eric:
> 
> Thank you very much for your kind reply, and also sorry for causing you confusion. 
> Actually, I do want to get crypto_user02 to run in more cases.
> 
> The product which I tested just only enable sha3 algorithm, but when I run cryto_user02, it tells "no viable algorithm found", as follows:
> ./crypto_user02
> tst_test.c:1365: TINFO: Timeout per run is 0h 05m 00s
> crypto_user02.c:84: TCONF: No viable algorithm found
> 
> Summary:
> passed   0
> failed   0
> broken   0
> skipped  1
> warnings 0
> 
> 
> I want crypto_user02 to support more cases(not only sha3), but I am not sure which algorithms should list, 
> so I compare with the latest linux kernel encryption module, add several hash algorithms which not list in crypto_user02.

Okay, can you please properly explain this in your commit message?

Thanks!

- Eric

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP] 答复: 答复: 答复:  [PATCH] add several hash algorithms for crypto/crypto_user02.c
  2022-01-11  3:03         ` Eric Biggers
@ 2022-01-11  3:11           ` wenyehai via ltp
  0 siblings, 0 replies; 7+ messages in thread
From: wenyehai via ltp @ 2022-01-11  3:11 UTC (permalink / raw)
  To: Eric Biggers; +Cc: ltp


Hi Eric:

Thank you very much for your prompt reply and suggestion. I will modify and explain this in my commit message later.


Best Regards
Yehai Wen

-----邮件原件-----
发件人: Eric Biggers [mailto:ebiggers@kernel.org] 
发送时间: 2022年1月11日 11:03
收件人: wenyehai <wenyehai@huawei.com>
抄送: ltp@lists.linux.it
主题: Re: 答复: 答复: [LTP] [PATCH] add several hash algorithms for crypto/crypto_user02.c

On Tue, Jan 11, 2022 at 02:19:05AM +0000, wenyehai wrote:
> 
> Hi Eric:
> 
> Thank you very much for your kind reply, and also sorry for causing you confusion. 
> Actually, I do want to get crypto_user02 to run in more cases.
> 
> The product which I tested just only enable sha3 algorithm, but when I run cryto_user02, it tells "no viable algorithm found", as follows:
> ./crypto_user02
> tst_test.c:1365: TINFO: Timeout per run is 0h 05m 00s
> crypto_user02.c:84: TCONF: No viable algorithm found
> 
> Summary:
> passed   0
> failed   0
> broken   0
> skipped  1
> warnings 0
> 
> 
> I want crypto_user02 to support more cases(not only sha3), but I am 
> not sure which algorithms should list, so I compare with the latest linux kernel encryption module, add several hash algorithms which not list in crypto_user02.

Okay, can you please properly explain this in your commit message?

Thanks!

- Eric

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-01-11  3:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04  9:15 [LTP] [PATCH] add several hash algorithms for crypto/crypto_user02.c wenyehai via ltp
2022-01-05 15:13 ` Eric Biggers
2022-01-10  3:59   ` [LTP] 答复: " wenyehai via ltp
2022-01-10 17:44     ` Eric Biggers
2022-01-11  2:19       ` [LTP] 答复: " wenyehai via ltp
2022-01-11  3:03         ` Eric Biggers
2022-01-11  3:11           ` [LTP] 答复: " wenyehai via ltp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.