From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69515C433EF for ; Sun, 26 Sep 2021 01:44:23 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 56B456108B for ; Sun, 26 Sep 2021 01:44:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 56B456108B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AB75F835DE; Sun, 26 Sep 2021 03:44:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="X+w+COh1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F2996835B6; Sun, 26 Sep 2021 03:44:03 +0200 (CEST) Received: from mail-oo1-xc34.google.com (mail-oo1-xc34.google.com [IPv6:2607:f8b0:4864:20::c34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0AAFA835A4 for ; Sun, 26 Sep 2021 03:43:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oo1-xc34.google.com with SMTP id v17-20020a4ae051000000b002b5a56e3da3so230115oos.2 for ; Sat, 25 Sep 2021 18:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H7QDYblTWdk7smXg54bMoFslfxSrJmaor+8hhTXYgBc=; b=X+w+COh1/vHdJB3A5WtsmJs7c3ZtxPQqBOCRx4yQi0jHLhj+esSDJ2TAvj4QnoMUam oDlNhv99rmH000iCkrWhnxQCPYQwbBaDpRY0GDzpCjqI7aie2GMBJZFi9ComG6oC2dVd UxTqp9S1Le4zblcPqBisf+ZxHs29OKcSYr3oY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H7QDYblTWdk7smXg54bMoFslfxSrJmaor+8hhTXYgBc=; b=1DZrn74aN0yWlblsGfgwJvRsQcEbBnxgZNPVM9S3iJpbYvgQRLsxNxHwfEmgjGCWrl LS9P1IRfzgNloUdItNHcrRQkWI9UuwJMnNnrkBP1/ZCvbq6TKNspDNHICEOZJwfRzk/D JnqtsqnjndyoI7HEmaJyK4M1YuGCDSP3NMRJheSEYKlC3IpzYr2UtzackW/HkhVxRsca mITa06qb1orN+zybWCS3YwkwQl9ZczSw34huuCvVKzCHgJ/4RNnblQK6rVRfvWQ1e+Ce oFidQv03WE7JpCWWUBL+escDGIZpxG/CBldb45fb06amlOpljSAUfH3mXhErWdvOrWFr 7dWg== X-Gm-Message-State: AOAM5318BYmsZ33+RlBY7uX2FvycubrB26bg0ZfFlXIGNLjVKTV5cy6Y PGFKsLf51yH1ddL854zV+Y0iZZg5dSHudQ== X-Google-Smtp-Source: ABdhPJwmRuBEdSdQ78CxJ4RtshwxNdF4yc+PV0QnL3W2BY+Vyc9g0MGmiF8MPyfcfoLHgyTmVdLuaw== X-Received: by 2002:a4a:e214:: with SMTP id b20mr12061529oot.1.1632620633513; Sat, 25 Sep 2021 18:43:53 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id c18sm330378otr.72.2021.09.25.18.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 18:43:53 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Alexandru Gagniuc , Andre Przywara , Rasmus Villemoes , Robert Marko , Masahiro Yamada , Tom Rini , Simon Glass Subject: [PATCH v5 04/29] spl: cypto: Bring back SPL_ versions of SHA Date: Sat, 25 Sep 2021 19:43:17 -0600 Message-Id: <20210926014342.127913-4-sjg@chromium.org> X-Mailer: git-send-email 2.33.0.685.g46640cef36-goog In-Reply-To: <20210926014342.127913-1-sjg@chromium.org> References: <20210926014342.127913-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Unfortunately these were removed by mistake. This means that adding hash support to SPL brings in all software algorithms, with a substantial increase in code size. The origin of the problem was renaming them to SPL_FIT_xxx and then these were removed altogether in a later commit. Add them back. This aligns with CONFIG_MD5, for example, which has an SPL variant. Signed-off-by: Simon Glass Fixes: f5bc9c25f31 ("image: Rename SPL_SHAxxx_SUPPORT to SPL_FIT_SHAxxx") Fixes: eb5171ddec9 ("common: Remove unused CONFIG_FIT_SHAxxx selectors") --- For now this has no effect but the next patch updates hash.c to deal with this condition for both SPL and tools. Changes in v5: - Add new patch to bring back SPL_ versions of SHA lib/Kconfig | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/lib/Kconfig b/lib/Kconfig index 034af724b5d..7899e756f99 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -373,7 +373,6 @@ config SHA256 The SHA256 algorithm produces a 256-bit (32-byte) hash value (digest). - config SHA512 bool "Enable SHA512 support" help @@ -399,6 +398,48 @@ config SHA_HW_ACCEL hashing algorithms. This affects the 'hash' command and also the hash_lookup_algo() function. +if SPL + +config SPL_SHA1 + bool "Enable SHA1 support in SPL" + default y if SHA1 + help + This option enables support of hashing using SHA1 algorithm. + The hash is calculated in software. + The SHA1 algorithm produces a 160-bit (20-byte) hash value + (digest). + +config SPL_SHA256 + bool "Enable SHA256 support in SPL" + default y if SHA256 + help + This option enables support of hashing using SHA256 algorithm. + The hash is calculated in software. + The SHA256 algorithm produces a 256-bit (32-byte) hash value + (digest). + +config SPL_SHA512 + bool "Enable SHA512 support in SPL" + default y if SHA512 + help + This option enables support of hashing using SHA512 algorithm. + The hash is calculated in software. + The SHA512 algorithm produces a 512-bit (64-byte) hash value + (digest). + +config SPL_SHA384 + bool "Enable SHA384 support in SPL" + default y if SHA384 + select SPL_SHA512 + help + This option enables support of hashing using SHA384 algorithm. + The hash is calculated in software. This is also selects SHA512, + because these implementations share the bulk of the code.. + The SHA384 algorithm produces a 384-bit (48-byte) hash value + (digest). + +endif + if SHA_HW_ACCEL config SHA512_HW_ACCEL -- 2.33.0.685.g46640cef36-goog