Received: by 10.192.165.156 with SMTP id m28csp215725imm; Wed, 18 Apr 2018 20:43:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx48MEBqLZvdZ3eKFaEFKOZCrcmH5AYrxIQsgAa+/wA+BxFMvDd9ZxnKNVEb5lURhkgBqEsZl X-Received: by 10.98.201.15 with SMTP id k15mr4314773pfg.184.1524109415751; Wed, 18 Apr 2018 20:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524109415; cv=none; d=google.com; s=arc-20160816; b=bmWXDJye6QuhMZw7OAvm56EBA0FCt80oAfwbYewJpkGSdLaE4vN5uJzKWpVUJfCHTq A430Ok4Dhn9V6ZXBczJ1Sxcd+05DPhEG0HauYpZ3/jz0sCp9ELjT8YE4Dbd+CWCJoXJ8 hpim41EFFKRRYGT//gL9uZMx+CZWwrjZGd6am0cWn27QbKgESc0FrHBBVUna7P9khZy0 MyTt9NGNbBIBQGf9FUhLOutsRrqEDnITfLO+zjTw2aB2KEh0fNeV5C1iWxQK1Lr2PGhV wtCOsnt0YxUVDSg3pgN2fSxiWneSoAZT1whGUyeeVXU/87NoxfvtnMxFHTvVjisV3G6J jRcA== 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:arc-authentication-results; bh=8JcMACyZMbK9jSc1D1aweSwMTqyuETpmUrSHG8qVfvQ=; b=qSudWv+BPoqKTYZCFsOJx/CJkmlufNeqJmqiai9ErISLhMbRT2XpYWHOWevZcJLKi0 3gxe3Jo1Q/TVqFQ0P49lDkdBN+hDZXFKR2kjcDv4QrAprjYVny90JGFITjROoaC2QQkn uuveo3y0/gmjEyIhIzlFgOCfkqe0LzAPvk8JkbhU7TC/CVOE/+dZiL4foUPtmbrhdmyf 2uJPPPbK9ZRpA6oifxTF4+g/ctmn41cdjVLVnNLndxYDjBx2hxOIqIl0TIY+7w9XM6MG C3Hke+01IiRc5B34e8rAaAJkvdeQZYdEnpQofTbYOVLC4Hn9yj02wt+N48+13zxemJbw PCPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 b10-v6si2464017plz.464.2018.04.18.20.43.21; Wed, 18 Apr 2018 20:43:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752810AbeDSDmQ (ORCPT + 99 others); Wed, 18 Apr 2018 23:42:16 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:45010 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752247AbeDSDmP (ORCPT ); Wed, 18 Apr 2018 23:42:15 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1f90Sc-00056L-72; Thu, 19 Apr 2018 11:42:14 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1f90SZ-00005S-48; Thu, 19 Apr 2018 11:42:11 +0800 Date: Thu, 19 Apr 2018 11:42:11 +0800 From: Herbert Xu To: Jan Glauber Cc: "David S . Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Mahipal Challa , Balakrishna Bhamidipati Subject: Re: [PATCH] crypto: testmgr: Allow different compression results Message-ID: <20180419034210.nsmzuf3f6lmn7suc@gondor.apana.org.au> References: <20180411182832.27761-1-jglauber@cavium.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180411182832.27761-1-jglauber@cavium.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 11, 2018 at 08:28:32PM +0200, Jan Glauber wrote: > > @@ -1362,7 +1373,17 @@ static int test_comp(struct crypto_comp *tfm, > goto out; > } > > - if (dlen != ctemplate[i].outlen) { > + ilen = dlen; > + dlen = COMP_BUF_SIZE; > + ret = crypto_comp_decompress(tfm, output, > + ilen, decomp_output, &dlen); > + if (ret) { > + pr_err("alg: comp: compression failed: decompress: on test %d for %s failed: ret=%d\n", > + i + 1, algo, -ret); > + goto out; > + } > + > + if (dlen != ctemplate[i].inlen) { > printk(KERN_ERR "alg: comp: Compression test %d " > "failed for %s: output len = %d\n", i + 1, algo, > dlen); Your patch is fine as it is. But I just thought I'd mention that if anyone wants to we should really change this to use a different tfm, e.g., always use the generic algorithm to perform the decompression. This way if there were multiple implementations we can at least test them against the generic one. Otherwise you could end up with a buggy implementation that works against itself but still generates incorrect output. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt