All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" 
	<linux-crypto@vger.kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [PATCH 5/6] crypto: arm64/aes-blk - update IV after partial final CTR block
Date: Thu, 14 Feb 2019 00:43:05 -0800	[thread overview]
Message-ID: <20190214084305.GC29560@sol.localdomain> (raw)
In-Reply-To: <CAKv+Gu_EuPpXvt0xLrA7H1fwWifCifpgaMDiZ_jvA0VT_7H21w@mail.gmail.com>

On Thu, Feb 14, 2019 at 09:33:51AM +0100, Ard Biesheuvel wrote:
> On Thu, 14 Feb 2019 at 09:28, Eric Biggers <ebiggers@kernel.org> wrote:
> >
> > On Thu, Feb 14, 2019 at 09:14:13AM +0100, Ard Biesheuvel wrote:
> > > On Thu, 14 Feb 2019 at 09:04, Eric Biggers <ebiggers@kernel.org> wrote:
> > > >
> > > > From: Eric Biggers <ebiggers@google.com>
> > > >
> > > > Make the arm64 ctr-aes-neon and ctr-aes-ce algorithms update the IV
> > > > buffer to contain the next counter after processing a partial final
> > > > block, rather than leave it as the last counter.  This makes these
> > > > algorithms pass the updated AES-CTR tests.
> > > >
> > > > Signed-off-by: Eric Biggers <ebiggers@google.com>
> > >
> > > I take it this means we return an output IV even if the algorithm
> > > could never proceed in a meaningful way, given that we throw away some
> > > keystream bits that would be needed in that case.
> > >
> > > That means this change is strictly there to make the test framework
> > > happy, even for cases that can never appear in reality.
> > >
> > > Wouldn't it be better not to set out_iv for input buffers whose size
> > > is not a multiple of the block size?
> > >
> >
> > See the explanation in patch 4 for why the tests test for this.  It's not a
> > super strong argument but this seems like the best thing to do.
> >
> 
> Fair enough.
> 
> Do you have a branch with this stuff that I can drop into kernelci
> again? Preferably one that already has the tests enabled by default,
> and panics on failure.

I pushed it out to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git
branch "iv-out-testing", and added a hack to enable self-tests by default and
panic on test failure.

- Eric

  reply	other threads:[~2019-02-14  8:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14  8:03 [PATCH 0/6] crypto: test that CBC and CTR update the IV Eric Biggers
2019-02-14  8:03 ` [PATCH 1/6] crypto: testmgr - remove extra bytes from 3DES-CTR IVs Eric Biggers
2019-02-14  8:03 ` [PATCH 2/6] crypto: testmgr - support checking skcipher output IV Eric Biggers
2019-02-14  8:03 ` [PATCH 3/6] crypto: testmgr - add iv_out to all CBC test vectors Eric Biggers
2019-02-14  8:03 ` [PATCH 4/6] crypto: testmgr - add iv_out to all CTR " Eric Biggers
2019-02-14  8:03 ` [PATCH 5/6] crypto: arm64/aes-blk - update IV after partial final CTR block Eric Biggers
2019-02-14  8:14   ` Ard Biesheuvel
2019-02-14  8:28     ` Eric Biggers
2019-02-14  8:33       ` Ard Biesheuvel
2019-02-14  8:43         ` Eric Biggers [this message]
2019-02-14  8:03 ` [PATCH 6/6] crypto: arm/aes-ce " Eric Biggers
2019-02-22 12:00 ` [PATCH 0/6] crypto: test that CBC and CTR update the IV Herbert Xu

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=20190214084305.GC29560@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=ard.biesheuvel@linaro.org \
    --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 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.