linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Pascal van Leeuwen <pascalvanl@gmail.com>
Cc: "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" 
	<linux-crypto@vger.kernel.org>,
	Antoine Tenart <antoine.tenart@bootlin.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Pascal van Leeuwen <pvanleeuwen@verimatrix.com>
Subject: Re: [PATCHv3] crypto: inside-secure - Fixed authenc w/ (3)DES fails on Macchiatobin
Date: Fri, 8 Nov 2019 09:57:43 +0100	[thread overview]
Message-ID: <CAKv+Gu9SahVL815i+8_f_fQPM2JP=3rpz3GLFhxLaAUrhz3HWA@mail.gmail.com> (raw)
In-Reply-To: <1573203234-8428-1-git-send-email-pvanleeuwen@verimatrix.com>

On Fri, 8 Nov 2019 at 09:57, Pascal van Leeuwen <pascalvanl@gmail.com> wrote:
>
> Fixed 2 copy-paste mistakes in the commit mentioned below that caused
> authenc w/ (3)DES to consistently fail on Macchiatobin (but strangely
> work fine on x86+FPGA??).
> Now fully tested on both platforms.
>
> changes since v1:
> - added Fixes: tag
>
> changes since v2:
> - moved Fixes: tag down near other tags
>

Please put the changelog below the ---
It does not belong in the commit log itself.


> Fixes: 13a1bb93f7b1c9 ("crypto: inside-secure - Fixed warnings on
> inconsistent byte order handling")
>
> Signed-off-by: Pascal van Leeuwen <pvanleeuwen@verimatrix.com>
> ---
>  drivers/crypto/inside-secure/safexcel_cipher.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/inside-secure/safexcel_cipher.c b/drivers/crypto/inside-secure/safexcel_cipher.c
> index 98f9fc6..c029956 100644
> --- a/drivers/crypto/inside-secure/safexcel_cipher.c
> +++ b/drivers/crypto/inside-secure/safexcel_cipher.c
> @@ -405,7 +405,8 @@ static int safexcel_aead_setkey(struct crypto_aead *ctfm, const u8 *key,
>
>         if (priv->flags & EIP197_TRC_CACHE && ctx->base.ctxr_dma) {
>                 for (i = 0; i < keys.enckeylen / sizeof(u32); i++) {
> -                       if (le32_to_cpu(ctx->key[i]) != aes.key_enc[i]) {
> +                       if (le32_to_cpu(ctx->key[i]) !=
> +                           ((u32 *)keys.enckey)[i]) {
>                                 ctx->base.needs_inv = true;
>                                 break;
>                         }
> @@ -459,7 +460,7 @@ static int safexcel_aead_setkey(struct crypto_aead *ctfm, const u8 *key,
>
>         /* Now copy the keys into the context */
>         for (i = 0; i < keys.enckeylen / sizeof(u32); i++)
> -               ctx->key[i] = cpu_to_le32(aes.key_enc[i]);
> +               ctx->key[i] = cpu_to_le32(((u32 *)keys.enckey)[i]);
>         ctx->key_len = keys.enckeylen;
>
>         memcpy(ctx->ipad, &istate.state, ctx->state_sz);
> --
> 1.8.3.1
>

  reply	other threads:[~2019-11-08  8:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08  8:53 [PATCHv3] crypto: inside-secure - Fixed authenc w/ (3)DES fails on Macchiatobin Pascal van Leeuwen
2019-11-08  8:57 ` Ard Biesheuvel [this message]
2019-11-08  9:02   ` Pascal Van Leeuwen
2019-11-08  9:19     ` Ard Biesheuvel

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='CAKv+Gu9SahVL815i+8_f_fQPM2JP=3rpz3GLFhxLaAUrhz3HWA@mail.gmail.com' \
    --to=ard.biesheuvel@linaro.org \
    --cc=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=pascalvanl@gmail.com \
    --cc=pvanleeuwen@verimatrix.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;
as well as URLs for NNTP newsgroup(s).