Re: [PATCH 3/5] crypto: blake2b - export helpers for optimized implementations

Eric Biggers
2020-12-17T22:35:20Z

On Thu, Dec 17, 2020 at 06:15:40PM +0100, David Sterba wrote:
> On Tue, Dec 15, 2020 at 03:47:06PM -0800, Eric Biggers wrote:
> > From: Eric Biggers <ebiggers@google.com>
> >
> > In preparation for adding architecture-specific implementations of
> > BLAKE2b, create a header <crypto/blake2b.h> that contains common
> > constants, structs, and helper functions for BLAKE2b.
> >
> > Furthermore, export the BLAKE2b generic setkey(), init(), update(), and
> > final() functions, and add functions __crypto_blake2b_update() and
> > __crypto_blake2b_final() which take a pointer to a
> > blake2b_compress_blocks_t function.
> >
> > This way, optimized implementations of BLAKE2b only have to provide an
> > implementation of blake2b_compress_blocks_t. (This is modeled on how
> > the nhpoly1305 implementations work. Also, the prototype of
> > blake2b_compress_blocks_t is meant to be similar to that of
> > blake2s_compress_arch().)
> >
> > Signed-off-by: Eric Biggers <ebiggers@google.com>
>
> Reviewed-by: David Sterba <dsterba@suse.com>

I ended up making some changes to this patch in v2, to keep things consistent
with what I decided to do for BLAKE2s, so I didn't add your Reviewed-by to this
patch. If you could review the new version too that would be great -- thanks!

- Eric