From: Eric Biggers <ebiggers@kernel.org>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au
Subject: Re: [PATCH crypto-next v6 1/3] crypto: poly1305 - add new 32 and 64-bit generic versions
Date: Tue, 17 Dec 2019 19:03:47 -0800 [thread overview]
Message-ID: <20191218030347.GC3636@sol.localdomain> (raw)
In-Reply-To: <20191217174445.188216-2-Jason@zx2c4.com>
On Tue, Dec 17, 2019 at 06:44:43PM +0100, Jason A. Donenfeld wrote:
> diff --git a/crypto/poly1305_generic.c b/crypto/poly1305_generic.c
> index 21edbd8c99fb..6488e8b8379c 100644
> --- a/crypto/poly1305_generic.c
> +++ b/crypto/poly1305_generic.c
> @@ -31,6 +31,29 @@ static int crypto_poly1305_init(struct shash_desc *desc)
> return 0;
> }
>
> +static unsigned int crypto_poly1305_setdesckey(struct poly1305_desc_ctx *dctx,
> + const u8 *src, unsigned int srclen)
> +{
> + if (!dctx->sset) {
> + if (!dctx->rset && srclen >= POLY1305_BLOCK_SIZE) {
> + poly1305_core_setkey((struct poly1305_core_key *)dctx->r, src);
Seems this should be using a union, so that all these casts to a different
struct type (which is normally undefined behavior) aren't needed.
- Eric
next prev parent reply other threads:[~2019-12-18 3:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-17 17:44 [PATCH crypto-next v6 0/3] crypto: poly1305 improvements Jason A. Donenfeld
2019-12-17 17:44 ` [PATCH crypto-next v6 1/3] crypto: poly1305 - add new 32 and 64-bit generic versions Jason A. Donenfeld
2019-12-18 3:03 ` Eric Biggers [this message]
2019-12-17 17:44 ` [PATCH crypto-next v6 2/3] crypto: x86_64/poly1305 - add faster implementations Jason A. Donenfeld
2019-12-18 2:31 ` Eric Biggers
2019-12-17 17:44 ` [PATCH crypto-next v6 3/3] crypto: arm/arm64/mips/poly1305 - remove redundant non-reduction from emit Jason A. Donenfeld
2019-12-18 2:48 ` [PATCH crypto-next v6 0/3] crypto: poly1305 improvements Eric Biggers
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=20191218030347.GC3636@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=Jason@zx2c4.com \
--cc=herbert@gondor.apana.org.au \
--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