Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2205394ybx; Fri, 8 Nov 2019 01:20:52 -0800 (PST) X-Google-Smtp-Source: APXvYqxVaGOIsk6LiX9s1R4VJrgd4d1tFexszvqF4LwXZML0fqmiS8HuV+EhLfA4URd5c6YQ8elA X-Received: by 2002:a17:906:3418:: with SMTP id c24mr7750137ejb.121.1573204852543; Fri, 08 Nov 2019 01:20:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573204852; cv=none; d=google.com; s=arc-20160816; b=zjLrm7gk5dEhKXFSL365lRzOCHlW3ZdaeNcdkNzSHLIJHvStWLuCfuzMpARChLomiN +E5ml13tz0EmhqDXCjFNAxFpE4yKPKdtSfCTXqlsS+TVySs85SqhR/0yN+eSWelRN7G4 MuLewybBt05V3yc6rOBxieUINGK408YAmRmcOHWFIUVmpKAOuqcjlMrqnJCq3JKGVjds JLgwS4YNUy3Ox+awU1zGTUKbo77M1WtE+4BUeEA58iB/VkXV/sFGmg2Yxp/u/FKdowDS 1E3Of6H4TTanerh7F3+Ob4y0ZB+OoSEoaOsgSGoqpGXrLgGZP7KGDU1ar//X6lyQ96r3 Bkgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ouMwsMlEiNGlppR6/Zfyl7B6UWYbphLKd4qLcZ70Vkw=; b=S4jYCuy/QfSYckUKW6ZS1lSqxramQH0VOpEVp4mWvy/mdezdzscSZmUBMX401AjaE3 q3eyI976oR80jv35B4Ox2ROvRHqo2Fh6jOIKGrozZBMzU0G6FZXkrPdSRcLRizkFhB6M P/+1pEuMOGoY+W+aqKxCb+75q1RKLb/Iojthy4On/Sj5aG4UlM3xyR0j8yKeHH/ATncf yEwfGUkwB5F67203+fdC0lbDmCn3kYPvwAAIUvt1E+dJ/o1rswcwMCL1MujMOAxY13HF 2TAHkziCaJnBV1uUb2I1aiRtB0KoO2BpkRbS5GJyVsMwkkkxtU51Rwz1dCGmU//6f9f3 UaEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x5VaPJJc; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k10si3302071edx.350.2019.11.08.01.20.27; Fri, 08 Nov 2019 01:20:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x5VaPJJc; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730616AbfKHJTk (ORCPT + 99 others); Fri, 8 Nov 2019 04:19:40 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40182 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728513AbfKHJTk (ORCPT ); Fri, 8 Nov 2019 04:19:40 -0500 Received: by mail-wm1-f68.google.com with SMTP id f3so5400532wmc.5 for ; Fri, 08 Nov 2019 01:19:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ouMwsMlEiNGlppR6/Zfyl7B6UWYbphLKd4qLcZ70Vkw=; b=x5VaPJJcvhwM7VuUw6uKJ5URotRdoKLUMsdEsg3980lOpgGY9dxGsRFj5FeDpX4a2d qnx/M/hlHT0qJx1hdYluT7Qqsy9BdwT4ZSvclPqbhyZ6gMV/9satY36TGk3LI75280S6 uFw8uZsPcJf+MD0Pgvl+z7zCWnzUbNzVu62GAk9xt4+Y+F/y1tqAKIx4SXTzjvTvpPjL Xp91jagr1zIjKpYFQtzbGfcVx3KhO0ilyyrhJ58ULrc1JxZaFeE1mirWChyxBg+Nji3K UW/Vwgpx7MgSTWaPviWh0F8CpArnh8Bpoua2gG7MAjY7xYPGMZg4XkgNtaZpraU0VPzt eoUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ouMwsMlEiNGlppR6/Zfyl7B6UWYbphLKd4qLcZ70Vkw=; b=GzN80R3J71s+aISRZ8mTg+Sr+sd8SVc8KuhQ77co4IzlqOsb/o01xe+zGZSRGigHrj NFfb2G73EXj5VDv+/u7JCfLpuYKV5gZzyDKdWocUKEVDW6WWzXBhgTfYENaCIoKwZVrL 5ZxifZGx7iPIKVsiEN4e5SX/Yiwjd1b4t7yGrs0thdRTCauP2gPRah8EIVDVdD1Tm/cJ XU55qDvl7mHhXPEB7d80zg7BbdSPmuU+STvX4glCj3at11taUbRgEgBHLNdsjaO0HKKP Ao+wC4zusTanirISHQu7H2b5ZBumt/hepCewoaCnfV5hBScdq07/xXmqG/OIYMGsaq7h yThA== X-Gm-Message-State: APjAAAXFyE+c8wuzsaA6HF/0Sfy+wyTCMdot07LccbJhdtv0TDY2BtsG AHe3yRXcD3C/5wK7r3dSDYGeaD757ZAnzJOSnj8BlQ== X-Received: by 2002:a7b:c392:: with SMTP id s18mr6531796wmj.61.1573204778116; Fri, 08 Nov 2019 01:19:38 -0800 (PST) MIME-Version: 1.0 References: <1573203234-8428-1-git-send-email-pvanleeuwen@verimatrix.com> In-Reply-To: From: Ard Biesheuvel Date: Fri, 8 Nov 2019 10:19:27 +0100 Message-ID: Subject: Re: [PATCHv3] crypto: inside-secure - Fixed authenc w/ (3)DES fails on Macchiatobin To: Pascal Van Leeuwen Cc: Pascal van Leeuwen , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Antoine Tenart , Herbert Xu , "David S. Miller" Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, 8 Nov 2019 at 10:02, Pascal Van Leeuwen wrote: > > > > > -----Original Message----- > > From: Ard Biesheuvel > > Sent: Friday, November 8, 2019 9:58 AM > > To: Pascal van Leeuwen > > Cc: open list:HARDWARE RANDOM NUMBER GENERATOR CORE ; > > Antoine Tenart ; Herbert Xu ; > > David S. Miller ; Pascal Van Leeuwen > > Subject: Re: [PATCHv3] crypto: inside-secure - Fixed authenc w/ (3)DES fails on > > Macchiatobin > > > > On Fri, 8 Nov 2019 at 09:57, Pascal van Leeuwen 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. > > > Really? I've always done it like that (just checked some of my previous > patches) and this is the first time someone complains about it ... > Well, the point is that formatting your patch correctly will make it easier for the maintainer to apply it, without having to open it in an editor and move things around or deleting them ('git am' automatically drops the content below ---) > > > > > Fixes: 13a1bb93f7b1c9 ("crypto: inside-secure - Fixed warnings on > > > inconsistent byte order handling") > > > > > > Signed-off-by: Pascal van Leeuwen > > > --- > > > 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 > > > > > > Regards, > Pascal van Leeuwen > Silicon IP Architect, Multi-Protocol Engines @ Verimatrix > www.insidesecure.com