Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp54561ybg; Mon, 8 Jun 2020 16:15:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnAzJzUTbc2erx1DqnCwxa8Gl09y2Me6y1u5NdFrqQv3c6qVehACssb6Ggct2aktGu23Rq X-Received: by 2002:aa7:d9d6:: with SMTP id v22mr25148720eds.66.1591658119880; Mon, 08 Jun 2020 16:15:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591658119; cv=none; d=google.com; s=arc-20160816; b=vQYacGWKoA6cUh3ekXpocKz4m45WNETnGAwuhAMrf6c8dLUEJeSf9q0sYkLeGr+fH2 Gf6m7xpokbniP4uzXs0C7fAGh8XUJn1wAjs78jllPsxG6ctR6Ojt250/rmbnemF7tqVP rSacu4I8K9QhIc1hYl8EYHrQKarK5Da4X3KvvYzL0J+F5EBeeUBmFDmsK2KdVyygYDuV uo9W9I4kLdoVikVkaG5wg/sxxsuIlZ37RFVhB/sX/lJlfEbH2hmX4BCAAG5Mym5NkLi3 UtZuNO/hCgB0RAerMTelCJ4orPiUDomVk/yT9cVk/TRuRPfqldnqgYQ2FXbiE4r0X7ze yZBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Soi3XBJAqHEk5i+n1XE96+tjix6ICBdpmZPZzatIm4Y=; b=S6O19einJ+pB+1EAu5tOUiYc1ufLEBdNKc2LpVoFuwW25HgHcA5+GN6D9ZPsuwfS5s RVG+Plvrqel1aLHhsf0w6BtioS+mZeFEomVtslYCKvIWVn7HJbK2zngKHy9mZDdwKP0a 0syNDDasJitp6piLWgJNu2gjSEs5NL8X54ZWWJdF4y14GNDZ+CyEplq8IQXd1kWJRBk0 QGo0OYvilixRqRCVbrJz3e2PqHOXdV5HshUMVBVrwHWTfeTVTCPPEA5rF6xUzMxtqRkk or1MbY1+PYjKJ1HR+0BVDiaPQsE72j6ZdumZ570mxeQPo+MmdVlGxxnrvHA5vz/b8bNx 10jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=De+4KpYG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c15si9725461eja.376.2020.06.08.16.14.57; Mon, 08 Jun 2020 16:15:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=De+4KpYG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729167AbgFHXMl (ORCPT + 99 others); Mon, 8 Jun 2020 19:12:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:57320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728795AbgFHXK6 (ORCPT ); Mon, 8 Jun 2020 19:10:58 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2DC3020CC7; Mon, 8 Jun 2020 23:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657858; bh=ulf2SztqD35ITArIHACtWdmO6AcDVM1Uqldkqoc+rQg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=De+4KpYGNwnXl/FdJsiQZUsI4wC686zjANFRFDfRkOO1SkcbUGc2QBzqfVjmkeC6u JEhRlqDuz2MWW1rWE3teUJrMNrByx38Cfncn5Sl9ux3kw6AEM6S18uR5P410LtuXfX xNzZol4PgvAWHb9muN396RV9Bn40AFkm5wKtkC2Q= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicolas Toromanoff , Herbert Xu , Sasha Levin , linux-crypto@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.7 221/274] crypto: stm32/crc32 - fix run-time self test issue. Date: Mon, 8 Jun 2020 19:05:14 -0400 Message-Id: <20200608230607.3361041-221-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Toromanoff [ Upstream commit a8cc3128bf2c01c4d448fe17149e87132113b445 ] Fix wrong crc32 initialisation value: "alg: shash: stm32_crc32 test failed (wrong result) on test vector 0, cfg="init+update+final aligned buffer" cra_name="crc32c" expects an init value of 0XFFFFFFFF, cra_name="crc32" expects an init value of 0. Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module") Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/stm32/stm32-crc32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/stm32/stm32-crc32.c b/drivers/crypto/stm32/stm32-crc32.c index c6156bf6c603..1c3e411b7acb 100644 --- a/drivers/crypto/stm32/stm32-crc32.c +++ b/drivers/crypto/stm32/stm32-crc32.c @@ -28,10 +28,10 @@ /* Registers values */ #define CRC_CR_RESET BIT(0) -#define CRC_INIT_DEFAULT 0xFFFFFFFF #define CRC_CR_REV_IN_WORD (BIT(6) | BIT(5)) #define CRC_CR_REV_IN_BYTE BIT(5) #define CRC_CR_REV_OUT BIT(7) +#define CRC32C_INIT_DEFAULT 0xFFFFFFFF #define CRC_AUTOSUSPEND_DELAY 50 @@ -65,7 +65,7 @@ static int stm32_crc32_cra_init(struct crypto_tfm *tfm) { struct stm32_crc_ctx *mctx = crypto_tfm_ctx(tfm); - mctx->key = CRC_INIT_DEFAULT; + mctx->key = 0; mctx->poly = CRC32_POLY_LE; return 0; } @@ -74,7 +74,7 @@ static int stm32_crc32c_cra_init(struct crypto_tfm *tfm) { struct stm32_crc_ctx *mctx = crypto_tfm_ctx(tfm); - mctx->key = CRC_INIT_DEFAULT; + mctx->key = CRC32C_INIT_DEFAULT; mctx->poly = CRC32C_POLY_LE; return 0; } -- 2.25.1