From: Herbert Xu <herbert@gondor.apana.org.au>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-crypto@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org, chang.seok.bae@intel.com
Subject: Re: [PATCH] crypto: x86/aes-xts - handle CTS encryption more efficiently
Date: Fri, 19 Apr 2024 19:04:20 +0800 [thread overview]
Message-ID: <ZiJPtK+cVWBXPn67@gondor.apana.org.au> (raw)
In-Reply-To: <20240412154559.91807-1-ebiggers@kernel.org>
Eric Biggers <ebiggers@kernel.org> wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> When encrypting a message whose length isn't a multiple of 16 bytes,
> encrypt the last full block in the main loop. This works because only
> decryption uses the last two tweaks in reverse order, not encryption.
>
> This improves the performance of decrypting messages whose length isn't
> a multiple of the AES block length, shrinks the size of
> aes-xts-avx-x86_64.o by 5.0%, and eliminates two instructions (a test
> and a not-taken conditional jump) when encrypting a message whose length
> *is* a multiple of the AES block length.
>
> While it's not super useful to optimize for ciphertext stealing given
> that it's rarely needed in practice, the other two benefits mentioned
> above make this optimization worthwhile.
>
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
> arch/x86/crypto/aes-xts-avx-x86_64.S | 53 +++++++++++++++-------------
> 1 file changed, 29 insertions(+), 24 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
prev parent reply other threads:[~2024-04-19 11:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 15:45 [PATCH] crypto: x86/aes-xts - handle CTS encryption more efficiently Eric Biggers
2024-04-19 11:04 ` Herbert Xu [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=ZiJPtK+cVWBXPn67@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=chang.seok.bae@intel.com \
--cc=ebiggers@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).