Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: dsterba@suse.cz, David Sterba <dsterba@suse.com>,
	linux-crypto@vger.kernel.org, ard.biesheuvel@linaro.org
Subject: Re: [PATCH v4 0/5] BLAKE2b generic implementation
Date: Sun, 13 Oct 2019 19:54:38 -0700	[thread overview]
Message-ID: <20191014025438.GB10007@sol.localdomain> (raw)
In-Reply-To: <20191013195052.GM2751@twin.jikos.cz>

On Sun, Oct 13, 2019 at 09:50:52PM +0200, David Sterba wrote:
> On Fri, Oct 11, 2019 at 10:57:40AM -0700, Eric Biggers wrote:
> > The choice of data lengths seems a bit unusual, as they include every length in
> > two ranges but nothing in between.  Also, none of the lengths except 0 is a
> > multiple of the blake2b block size.  Instead, maybe use something like
> > [0, 1, 7, 15, 64, 247, 256]?
> 
> Just to clarify, do you mean the block size defined by BLAKE2B_BLOCKBYTES?
> That's 128, so that makes 0 and 256 the multiples.

Yes.

> 
> > Also, since the 4 variants share nearly all their code, it seems the tests would
> > be just as effective in practice if we cut the test vectors down by 4x by
> > distributing the key lengths among each variant.  Like:
> > 
> >           blake2b-160  blake2b-256  blake2b-384  blake2b-512
> >          ---------------------------------------------------
> > len=0   | klen=0       klen=1       klen=16      klen=32
> > len=1   | klen=16      klen=32      klen=0       klen=1
> > len=7   | klen=32      klen=0       klen=1       klen=16
> > len=15  | klen=1       klen=16      klen=32      klen=0
> > len=64  | klen=0       klen=1       klen=16      klen=32
> > len=247 | klen=16      klen=32      klen=0       klen=1
> > len=256 | klen=32      klen=0       klen=1       klen=16
> 
> That's clever. I assume the 32 key length refers to the default key,
> right? That's 64 bytes (BLAKE2B_KEYBYTES), so I'll use that value.
> 

Yes, I meant key lengths [0, 1, 32, 64].  I forgot that BLAKE2b has a max key
length of 64 bytes rather than 32.

- Eric

      reply	other threads:[~2019-10-14  2:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 16:52 [PATCH v4 0/5] BLAKE2b generic implementation David Sterba
2019-10-11 16:52 ` [PATCH v4 1/5] crypto: add blake2b " David Sterba
2019-10-11 18:04   ` Eric Biggers
2019-10-13 17:44     ` David Sterba
2019-10-11 18:11   ` Eric Biggers
2019-10-11 16:52 ` [PATCH v4 2/5] crypto: add test vectors for blake2b-160 David Sterba
2019-10-11 16:52 ` [PATCH v4 3/5] crypto: add test vectors for blake2b-256 David Sterba
2019-10-11 16:52 ` [PATCH v4 4/5] crypto: add test vectors for blake2b-384 David Sterba
2019-10-11 16:52 ` [PATCH v4 5/5] crypto: add test vectors for blake2b-512 David Sterba
2019-10-11 17:15 ` [PATCH v4 0/5] BLAKE2b generic implementation David Sterba
2019-10-11 17:57 ` Eric Biggers
2019-10-13 19:50   ` David Sterba
2019-10-14  2:54     ` Eric Biggers [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=20191014025438.GB10007@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=linux-crypto@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox