public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Thorsten Blum <thorsten.blum@toblux.com>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
	kees@kernel.org, gustavoars@kernel.org,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH] crypto: chacha20poly1305 - Annotate struct chachapoly_ctx with __counted_by()
Date: Mon, 5 Aug 2024 10:59:32 -0700	[thread overview]
Message-ID: <20240805175932.GB1564@sol.localdomain> (raw)
In-Reply-To: <20240805175237.63098-2-thorsten.blum@toblux.com>

On Mon, Aug 05, 2024 at 07:52:38PM +0200, Thorsten Blum wrote:
>  struct poly_req {
> @@ -611,8 +611,8 @@ static int chachapoly_create(struct crypto_template *tmpl, struct rtattr **tb,
>  				       poly->base.cra_priority) / 2;
>  	inst->alg.base.cra_blocksize = 1;
>  	inst->alg.base.cra_alignmask = chacha->base.cra_alignmask;
> -	inst->alg.base.cra_ctxsize = sizeof(struct chachapoly_ctx) +
> -				     ctx->saltlen;
> +	inst->alg.base.cra_ctxsize = struct_size_t(struct chachapoly_ctx, salt,
> +						   ctx->saltlen);

What was wrong with the more straightforward code it had before?

- Eric

  reply	other threads:[~2024-08-05 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-05 17:52 [PATCH] crypto: chacha20poly1305 - Annotate struct chachapoly_ctx with __counted_by() Thorsten Blum
2024-08-05 17:59 ` Eric Biggers [this message]
2024-08-05 20:32   ` Thorsten Blum
2024-08-05 20:49 ` Kees Cook

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=20240805175932.GB1564@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=davem@davemloft.net \
    --cc=gustavoars@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=kees@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thorsten.blum@toblux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox