Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Eric Biggers <ebiggers@kernel.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: Re: ARM CE: CTS IV handling
Date: Tue, 19 May 2020 19:35:22 +0200	[thread overview]
Message-ID: <8691076.XE7dyB1q2z@tauon.chronox.de> (raw)
In-Reply-To: <CAMj1kXHscmtLq=tA7zUgiNqZYgTFjfREL5EK6ZnoDCFp52GWGw@mail.gmail.com>

Am Dienstag, 19. Mai 2020, 18:21:01 CEST schrieb Ard Biesheuvel:

Hi Ard,

> 
> To be honest, this looks like the API is being used incorrectly. Is
> this a similar issue to the one Herbert spotted recently with the CTR
> code?
> 
> When you say 'leaving the TFM untouched' do you mean the skcipher
> request? The TFM should not retain any per-request state in the first
> place.
> 
> The skcipher request struct is not meant to retain any state either -
> the API simply does not support incremental encryption if the input is
> not a multiple of the chunksize.
> 
> Could you give some sample code on how you are using the API in this case?

What I am doing technically is to allocate a new tfm and request at the 
beginning and then reuse the TFM and request. In that sense, I think I violate 
that constraint.

But in order to implement such repetition, I can surely clear / allocate a new 
TFM. But in order to get that right, I need the resulting IV after the cipher 
operation.

This IV that I get after the cipher operation completes is different between C 
and CE.

Ciao
Stephan



  reply	other threads:[~2020-05-19 17:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 15:31 ARM CE: CTS IV handling Stephan Mueller
2020-05-19 16:21 ` Ard Biesheuvel
2020-05-19 17:35   ` Stephan Mueller [this message]
2020-05-19 17:50     ` Ard Biesheuvel
2020-05-19 17:53       ` Ard Biesheuvel
2020-05-19 18:11         ` Stephan Mueller

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=8691076.XE7dyB1q2z@tauon.chronox.de \
    --to=smueller@chronox.de \
    --cc=ard.biesheuvel@linaro.org \
    --cc=ardb@kernel.org \
    --cc=ebiggers@kernel.org \
    --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