Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2177931ybx; Fri, 8 Nov 2019 00:52:17 -0800 (PST) X-Google-Smtp-Source: APXvYqwUZ2//SBjDv9fGdF5UE2xjhYXEj1rGHVv5vifJyyYPPFCABLtQV9VSN59Er54/4zgnvNSN X-Received: by 2002:aa7:d652:: with SMTP id v18mr8784747edr.184.1573203137127; Fri, 08 Nov 2019 00:52:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573203137; cv=none; d=google.com; s=arc-20160816; b=fw70O4toPt99/WerHmONQBWLxVqgQzFVp9tCbwoIEzhWs039YI2/ybJHt8hbvTKrTt H0kOX2Teb6xcQt42zMb9c0UNkj7VT1KbkgM/N9fsj+9QpuhfIl4h/LTb/ViipQ/6PUpO tfet81GxRWoQTborInw5oFac1BKtVcutAXqlDygCDmY6xF43jh5MZH6Rzn1gDnNB0/JZ R1+5GnIrejGm98OI0P2EcIr7gKh+Jtb7HBhZevoAbXhDvStmVN/h9M1B8nfngP0ukRlC 6rJlGzejry+jfx/um10JaQ/yeZKSz4hIS4OO3/GVS2IXQMDdDNDdQqqiwYJn40N1/itP H3Dw== 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=RqoRZnWQGHNYKjEHFSAUc6XzTWpxo+kDLam/5PYLXLk=; b=AbHpZGUYSWazyICHFEcceBZt0jMTmR0GPb3C2BFvXz7CmT7OVNchVizMLBcY0Yw5pU JrwWID1WNNVlOuLJ+afWiG5Ljzj0UQzJzRTlkb2cOV0xsMQWGSX3PE3qjj60mzeeaAqD BqkEVjTT84UgquqZvbFeQwt+HW0OTShXdLl6MhUQJNHFvzi/jTUTE3CVUXTvi92hJool f8z1iz+okZCmgfo0ksBvOu3HQRO1+cx+VYgiHaCZE+kshsSiZWpQI5W8qYIEq7wOauLm yOTfPPAWp+P5aBIFbiS7i4ocOtgAyFhZ4oTKTyy/XFHhQc4ERYmlV+8gupCTqM7qlCPT L4Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EdU4w6aA; 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 d26si3226315ejr.361.2019.11.08.00.51.52; Fri, 08 Nov 2019 00:52:17 -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=EdU4w6aA; 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 S1727649AbfKHIvr (ORCPT + 99 others); Fri, 8 Nov 2019 03:51:47 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36536 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725975AbfKHIvr (ORCPT ); Fri, 8 Nov 2019 03:51:47 -0500 Received: by mail-wr1-f67.google.com with SMTP id r10so6090923wrx.3 for ; Fri, 08 Nov 2019 00:51:43 -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=RqoRZnWQGHNYKjEHFSAUc6XzTWpxo+kDLam/5PYLXLk=; b=EdU4w6aAQm65gGI/6/X2Z0CqJJJCQIqgir4bPjeeOko6D56E3u32k7Ukk3GoFWx/pG n/vEemzttYQYQB96OYK+6hqhyH5pgBATD1nV8SI6Z7lz4+1pbHco375XKsdMbLa6KOWk Z8yhl38reh5XMAs9Oio/6k5Rf98/08zbGE9uiWuloHL15fvzg9zRrK0sX/LaAdAxHfdh pvgxX8HrhlC/ic+36PNP4MWBy7p38+f+94KNvFxuj3/oZxusxKSp5qbWurILvE9Cap8U iq4bmzuNCfkzjKQ2UDOsvHIa7y42jkiF5UdPrgt9AYKeNBOBsc0SzdSZKeEsINZ592Cf Y2ng== 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=RqoRZnWQGHNYKjEHFSAUc6XzTWpxo+kDLam/5PYLXLk=; b=Mxfj4Bl8g71oaU6LeQ1ygWdc4E4zgAtKo/DVr6l1nIPxmRWBDMakwPJ0kAbliOy6Of ZzbulX5aOe+klA6u3CCJUHMoqrwtIm6qGkZA1iHRAjh1VbvBdvwbmEz4G38DoMmCu9Gj n84AdIceAeUOcbIsfhq/cQHPaza9pR+VJWUsCNPetgbgRJEkgJ454cbtXeGJjibcE/gH PPjEj+KDKqbi85kF/CzYuzSZjtljTyUzE5gEjYgT7ueNmM1A4LHATRCP8eJZjBQvShid yI2P1MMg3yX53uNpjK8nzEbiWeAZDLhZTGyKC7djZ5IjSIdnbr+eMzN9v+oGeGZoK6WK iEyQ== X-Gm-Message-State: APjAAAX14qmSgyPRjDXOwZfKj44IgCPDrazfd7bS06OrB6FEWo66YeYL HWJ2Xg90JtTz2641oVWTvVKKmWbvd95TotWazmh2Lg== X-Received: by 2002:adf:f685:: with SMTP id v5mr7611440wrp.246.1573203102921; Fri, 08 Nov 2019 00:51:42 -0800 (PST) MIME-Version: 1.0 References: <1573202847-8292-1-git-send-email-pvanleeuwen@verimatrix.com> In-Reply-To: <1573202847-8292-1-git-send-email-pvanleeuwen@verimatrix.com> From: Ard Biesheuvel Date: Fri, 8 Nov 2019 09:51:31 +0100 Message-ID: Subject: Re: [PATCHv2] crypto: inside-secure - Fixed authenc w/ (3)DES fails on Macchiatobin To: Pascal van Leeuwen Cc: "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Antoine Tenart , Herbert Xu , "David S. Miller" , Pascal van Leeuwen 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 09:50, Pascal van Leeuwen wrote: > > Fixes: 13a1bb93f7b1c9 ("crypto: inside-secure - Fixed warnings on > inconsistent byte order handling") > Please put the fixes tag with the tags (S-o-b etc) > Fixed 2 copy-paste mistakes in the abovementioned commit 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 > Please put your changelog below the --- > 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 >