All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: David Sterba <dsterba@suse.com>,
	"open list:HARDWARE RANDOM NUMBER GENERATOR CORE" 
	<linux-crypto@vger.kernel.org>
Subject: Re: [PATCH v2] crypto: add blake2b generic implementation
Date: Thu, 10 Oct 2019 15:56:51 +0200	[thread overview]
Message-ID: <20191010135651.GS2751@twin.jikos.cz> (raw)
In-Reply-To: <CAKv+Gu9ccLRt-g-3WipF2rc5zXSVVounj8cDqAGS730kqH6vdw@mail.gmail.com>

Hi,

On Wed, Oct 09, 2019 at 03:47:09PM +0200, Ard Biesheuvel wrote:
> I have a couple more comments - apologies for not spotting these the
> first time around.

No problem, there was a lot of churn since v1.

> > +enum {
> > +       BLAKE2_DUMMY_2 = 1 / (sizeof(struct blake2b_param) == BLAKE2B_OUTBYTES)
> > +};
> > +
> 
> Please use BUILD_BUG_ON(<condition>) to do compile time sanity checks.
> (You'll have to move it into a C function though)

Fixed.

> > +int blake2b_init_key(struct blake2b_state *S, size_t outlen, const void *key,
> 
> This should be static, and given that it is not used anywhere, you
> should either remove it or wire it up.
> 
> Given that blake2 can be used as a keyed hash as well as an unkeyed
> hash, I propose that you implement the setkey() hook, and add
> CRYPTO_ALG_OPTIONAL_KEY to the cra_flags to convey that setkey() is
> optional.

Ok, setkey will be in v3.

> > +int blake2b_init(struct blake2b_state *S, size_t outlen);
> > +int blake2b_init_key(struct blake2b_state *S, size_t outlen, const void *key, size_t keylen);
> > +int blake2b_update(struct blake2b_state *S, const void *in, size_t inlen);
> > +int blake2b_final(struct blake2b_state *S, void *out, size_t outlen);
> 
> Drop these please.

Done, with the additional 'static' fixups.

      reply	other threads:[~2019-10-10 13:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 10:22 [PATCH v2] crypto: add blake2b generic implementation David Sterba
2019-10-09 13:47 ` Ard Biesheuvel
2019-10-10 13:56   ` David Sterba [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=20191010135651.GS2751@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dsterba@suse.com \
    --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 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.