All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Nikolay Borisov <nborisov@suse.com>
Cc: davem@davemloft.net, ebiggers@kernel.org,
	linux-crypto@vger.kernel.org, terrelln@fb.com,
	jthumshirn@suse.de
Subject: Re: [PATCH v4] crypto: xxhash - Implement xxhash support
Date: Thu, 6 Jun 2019 14:51:34 +0800	[thread overview]
Message-ID: <20190606065134.jjq4upsfve4hq755@gondor.apana.org.au> (raw)
In-Reply-To: <20190530065257.13174-1-nborisov@suse.com>

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 <nborisov@suse.com>
> ---
> 
> V4: 
>  * Renamed couple more shash_desc_ctx variable to "dctx" (Eric Biggers)
>  * Removed _finup method  (Eric Biggers)
>  * Implemented _digest method by directly calling xxh64() (Eric Biggers)
> 
>  crypto/Kconfig          |   8 +++
>  crypto/Makefile         |   1 +
>  crypto/testmgr.c        |   7 +++
>  crypto/testmgr.h        | 106 +++++++++++++++++++++++++++++++++++++++
>  crypto/xxhash_generic.c | 108 ++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 230 insertions(+)
>  create mode 100644 crypto/xxhash_generic.c

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      parent reply	other threads:[~2019-06-06  6:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30  6:52 [PATCH v4] crypto: xxhash - Implement xxhash support Nikolay Borisov
2019-05-30 16:55 ` Eric Biggers
2019-06-06  6:51 ` Herbert Xu [this message]

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=20190606065134.jjq4upsfve4hq755@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=ebiggers@kernel.org \
    --cc=jthumshirn@suse.de \
    --cc=linux-crypto@vger.kernel.org \
    --cc=nborisov@suse.com \
    --cc=terrelln@fb.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.