Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1357273ybg; Fri, 18 Oct 2019 16:38:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwosPEv+bf3elq3f/oM9vfy4ERQ0oEnmHDN2qwm6Ty4gAUXLMiq6YMsw0tKZCbnUGLRmZDR X-Received: by 2002:a50:8986:: with SMTP id g6mr1872022edg.67.1571441902598; Fri, 18 Oct 2019 16:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571441902; cv=none; d=google.com; s=arc-20160816; b=nN5caNvmeRd/3lQVjcKq5k6NjQFZLUlIgLnlB8zBCdlmzrezAjOtM7s2w505R89wu8 r4UKxKXjRJzI8gBTH5w41Ym2n6/MtO4NlWPxJwqtNA3Ad0QKbO/GGuqgHba79K6969fS u8kgo2hYoEhQ3ipx4AdN1f6zm8JsZxP0HoPsz76lbBTXHigR/hIdJG6anO6rTYx0aIPq AwZuOcQ53of8NjZYXXI0Y4/Nq2vEc2RE3n/JzrKPuyuzNsrlxGXOTEl4Hf+ckQA24bIJ UI3oxBvY4ZuC3EgPgtrLuNgI5a3GQN3x4lvhyLrxErjRk/uLoVK+vGMUKfn6dPmuGMwx 7ZfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Kr3tMyzKY6voO++ij4+P4rsdE274ons1andlonC5mKo=; b=gwvypq610jO6tVyL01s0dTHRSExHpsT9OJDIYjixY2tACtR0BmhDsP0m7mE0t7vvBD zbVOKhWr9L1brYJfzDqbbZpk16Y1SFt218xr/8Cd9basoJfaf5sivrri9fup7wP+eH2l eHoeBnjzx43Hdcg9l3JHQe8q/kGJyP1XdjMdIuGnNBsxTRlJacvhPzVL6BckoGRoRT8y 80Gy6oO+qtyQZ3HMIlE7IoJ6bCzfVfPf3ftrUGoLuSGU0wWI7vM7vuNVSMgKh9oA/+Cu HZUgIWnnJK80x+JJcDCAI664VfLRm3YBBv6MGtOAAd9G2xI69tRowUi0KjF4L31FnqGz s++Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 57si5809396edz.280.2019.10.18.16.37.56; Fri, 18 Oct 2019 16:38:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504559AbfJRHOi (ORCPT + 99 others); Fri, 18 Oct 2019 03:14:38 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:37140 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728008AbfJRHOh (ORCPT ); Fri, 18 Oct 2019 03:14:37 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.89 #2 (Debian)) id 1iLMSz-00038S-Ny; Fri, 18 Oct 2019 18:14:30 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 18 Oct 2019 18:14:24 +1100 Date: Fri, 18 Oct 2019 18:14:24 +1100 From: Herbert Xu To: Zhou Wang Cc: "David S. Miller" , linux-crypto@vger.kernel.org, linuxarm@huawei.com Subject: Re: [PATCH] crypto: zlib-deflate - add zlib-deflate test case in tcrypt Message-ID: <20191018071424.GA16131@gondor.apana.org.au> References: <1570695707-46528-1-git-send-email-wangzhou1@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1570695707-46528-1-git-send-email-wangzhou1@hisilicon.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 > --- > 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. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt