Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1001066ybi; Thu, 30 May 2019 09:57:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzNbttQ7cwqnkk/HRSPrkbv6I9u43KRfj75IeUnlz9KtNLiJEUMgk1lY1snxTDwD3tKALz X-Received: by 2002:a63:81c2:: with SMTP id t185mr4636291pgd.257.1559235463606; Thu, 30 May 2019 09:57:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559235463; cv=none; d=google.com; s=arc-20160816; b=QLYrtQD8dpoe4dK3ZnmWmgpTl8882pv9CqWC2tlp1UngNpwnSnSrsGh49eDzo3U6Yo yoqizm0zzWRtaUKgrzbdhHlikc65sARsJ6vyRd7OoVJFve6q1tKaDYHtzL3W/PxzYQBy KPHo72POZ9MMhUlf31dIO5os1wGItp5Pvq4xBJr1j2hOxZcXoMy9AOTc0SIIN9vZXly/ eR8N2IEbItaBQcysi0cl9+0bfAA2TdwxriVgqpGIX3k5QFniqIzD1G3yUKUuit4Kmcbs DDcbipYueOc5brt21+dws4hzayeZ/k4CZxZdi4744bhc17bK79RkW7p9ORF/H6ioNi1/ 2Hew== 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:dkim-signature; bh=KsIFdRSzL7yJCyv7s46oh76cR8WW2L4y9KpqYlfAXWY=; b=uOAoruiIWcWVlYi+905/J2z/po5dRW1cVqpHcPdXDuz+0IeJGwJ4Qaaq65jmZ3oRUr utqFYGTYOQq0M5A2bebyI/Jd6/bU88JcTJuQQYooefc/vyWa+ADvu1korr4l8cxdh5SO LKS8sUAt2IdnDyU91BiFb237Kb+MJFNEgeaJe0vFpCath40I43d9wdwtOjbEn6iRksW8 AGIWtiEPvBHlEav1meJzLoyqwydhUkXX0KBb6AjEXfRyBN+lb/q/sOL8IoQgw6sPJ91i LAA+pRBzT0hCey70mmQH9tlPLTMxbtrV9DYD88UqYMUrNWzY+b2pXRMbHul4ijTzs3Vd XBxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lr1PNDBy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si3567516plh.289.2019.05.30.09.57.21; Thu, 30 May 2019 09:57:43 -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; dkim=pass header.i=@kernel.org header.s=default header.b=lr1PNDBy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727377AbfE3QzO (ORCPT + 99 others); Thu, 30 May 2019 12:55:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:35622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727141AbfE3QzO (ORCPT ); Thu, 30 May 2019 12:55:14 -0400 Received: from gmail.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 054F225DDF; Thu, 30 May 2019 16:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559235313; bh=+amcZveniinSrBT+Vlc49ya+ayzBMXpVqMJ/np0of18=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lr1PNDByOges69amdPcfZYxaUBv4Yg1UGTBVdtfzZDArw6XXAZ6eSjKDGaSF2w0Py muN0ZOiVAxv67UAtvPx3M/Qq4lmmmj/eCZm0fWd0qpPh4YHX/8xMD6LM49sbkDpvg7 S5KI8OWtP1cguq7Fpuq3ehg1z1JODYv469KiNaL8= Date: Thu, 30 May 2019 09:55:11 -0700 From: Eric Biggers To: Nikolay Borisov Cc: herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, terrelln@fb.com, jthumshirn@suse.de Subject: Re: [PATCH v4] crypto: xxhash - Implement xxhash support Message-ID: <20190530165510.GA70051@gmail.com> References: <20190530065257.13174-1-nborisov@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190530065257.13174-1-nborisov@suse.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, May 30, 2019 at 09:52:57AM +0300, Nikolay Borisov wrote: > xxhash is currently implemented as a self-contained module in /lib. > This patch enables that module to be used as part of the generic kernel > crypto framework. It adds a simple wrapper to the 64bit version. > > I've also added test vectors (with help from Nick Terrell). The upstream > xxhash code is tested by running hashing operation on random 222 byte > data with seed values of 0 and a prime number. The upstream test > suite can be found at https://github.com/Cyan4973/xxHash/blob/cf46e0c/xxhsum.c#L664 > > Essentially hashing is run on data of length 0,1,14,222 with the > aforementioned seed values 0 and prime 2654435761. The particular random > 222 byte string was provided to me by Nick Terrell by reading > /dev/random and the checksums were calculated by the upstream xxsum > utility with the following bash script: > > dd if=/dev/random of=TEST_VECTOR bs=1 count=222 > > for a in 0 1; do > for l in 0 1 14 222; do > for s in 0 2654435761; do > echo algo $a length $l seed $s; > head -c $l TEST_VECTOR | ~/projects/kernel/xxHash/xxhsum -H$a -s$s > done > done > done > > This produces output as follows: > > algo 0 length 0 seed 0 > 02cc5d05 stdin > algo 0 length 0 seed 2654435761 > 02cc5d05 stdin > algo 0 length 1 seed 0 > 25201171 stdin > algo 0 length 1 seed 2654435761 > 25201171 stdin > algo 0 length 14 seed 0 > c1d95975 stdin > algo 0 length 14 seed 2654435761 > c1d95975 stdin > algo 0 length 222 seed 0 > b38662a6 stdin > algo 0 length 222 seed 2654435761 > b38662a6 stdin > algo 1 length 0 seed 0 > ef46db3751d8e999 stdin > algo 1 length 0 seed 2654435761 > ac75fda2929b17ef stdin > algo 1 length 1 seed 0 > 27c3f04c2881203a stdin > algo 1 length 1 seed 2654435761 > 4a15ed26415dfe4d stdin > algo 1 length 14 seed 0 > 3d33dc700231dfad stdin > algo 1 length 14 seed 2654435761 > ea5f7ddef9a64f80 stdin > algo 1 length 222 seed 0 > 5f3d3c08ec2bef34 stdin > algo 1 length 222 seed 2654435761 > 6a9df59664c7ed62 stdin > > algo 1 is xx64 variant, algo 0 is the 32 bit variant which is currently > not hooked up. > > Signed-off-by: Nikolay Borisov > --- Looks fine now. Reviewed-by: Eric Biggers - Eric