From: Zhou Wang <wangzhou1@hisilicon.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
<linux-crypto@vger.kernel.org>, <linuxarm@huawei.com>
Subject: Re: [PATCH] crypto: zlib-deflate - add zlib-deflate test case in tcrypt
Date: Mon, 21 Oct 2019 12:00:00 +0800 [thread overview]
Message-ID: <5DAD2D40.6000901@hisilicon.com> (raw)
In-Reply-To: <20191018071424.GA16131@gondor.apana.org.au>
On 2019/10/18 15:14, Herbert Xu wrote:
> On Thu, Oct 10, 2019 at 04:21:47PM +0800, Zhou Wang wrote:
>> As a type CRYPTO_ALG_TYPE_ACOMPRESS is needed to trigger crypto acomp test,
>> we introduce a new help function tcrypto_test_extend to pass type and mask
>> to alg_test.
>>
>> Then tcrypto module can be used to do basic acomp test by:
>> insmod tcrypto.ko alg="zlib-deflate" mode=55 type=10
>>
>> Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
>> ---
>> crypto/tcrypt.c | 19 ++++++++++++++++++-
>> 1 file changed, 18 insertions(+), 1 deletion(-)
>>
>> diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
>> index 83ad0b1..6ad821c 100644
>> --- a/crypto/tcrypt.c
>> +++ b/crypto/tcrypt.c
>> @@ -72,7 +72,7 @@ static char *check[] = {
>> "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt",
>> "camellia", "seed", "salsa20", "rmd128", "rmd160", "rmd256", "rmd320",
>> "lzo", "lzo-rle", "cts", "sha3-224", "sha3-256", "sha3-384",
>> - "sha3-512", "streebog256", "streebog512",
>> + "sha3-512", "streebog256", "streebog512", "zlib-deflate",
>> NULL
>> };
>>
>> @@ -1657,6 +1657,19 @@ static inline int tcrypt_test(const char *alg)
>> return ret;
>> }
>>
>> +static inline int tcrypt_test_extend(const char *alg, u32 type, u32 mask)
>> +{
>> + int ret;
>> +
>> + pr_debug("testing %s\n", alg);
>> +
>> + ret = alg_test(alg, alg, type, mask);
>> + /* non-fips algs return -EINVAL in fips mode */
>> + if (fips_enabled && ret == -EINVAL)
>> + ret = 0;
>> + return ret;
>> +}
>> +
>> static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
>> {
>> int i;
>> @@ -1919,6 +1932,10 @@ static int do_test(const char *alg, u32 type, u32 mask, int m, u32 num_mb)
>> ret += tcrypt_test("streebog512");
>> break;
>>
>> + case 55:
>> + ret += tcrypt_test_extend("zlib-deflate", type, mask);
>> + break;
>> +
>
> Is this really needed? When you do
>
> modprobe tcrypt alg="zlib-deflate" type=10 mask=15
>
> It should cause zlib-defalte to be registered as acomp and therefore
> tested automatically.
seems it can not work, when I run insmod tcrypt.ko alg="zlib-deflate" type=10 mask=15
I got: insmod: can't insert 'tcrypt.ko': Resource temporarily unavailable
crypto_has_alg in case 0 in do_test does find "zlib-deflate", however, it breaks and
do nothing about test.
Best,
Zhou
>
> Cheers,
>
next prev parent reply other threads:[~2019-10-21 4:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 8:21 [PATCH] crypto: zlib-deflate - add zlib-deflate test case in tcrypt Zhou Wang
2019-10-17 6:12 ` Zhou Wang
2019-10-18 7:14 ` Herbert Xu
2019-10-21 4:00 ` Zhou Wang [this message]
2019-10-21 5:45 ` Herbert Xu
2019-10-21 8:45 ` Zhou Wang
2019-10-22 6:15 ` Herbert Xu
2019-10-22 7:04 ` Zhou Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5DAD2D40.6000901@hisilicon.com \
--to=wangzhou1@hisilicon.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linuxarm@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.