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 08EE1C433F5 for ; Tue, 5 Oct 2021 18:19:54 +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 72FF961130 for ; Tue, 5 Oct 2021 18:19:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 72FF961130 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 3F60382BC7; Tue, 5 Oct 2021 20:19:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="P1XjTfAN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 466B9807CD; Tue, 5 Oct 2021 20:19:49 +0200 (CEST) Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) (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 C2B2C807CD for ; Tue, 5 Oct 2021 20:19:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mr.nuke.me@gmail.com Received: by mail-oi1-x229.google.com with SMTP id z11so492878oih.1 for ; Tue, 05 Oct 2021 11:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=kpCHUT6c9swYOgw26ak8qxJeq6HYz5et5h+gs7NJPKA=; b=P1XjTfANj/1pvX3vZDfrah2aFp7eFAqRw2xwdayy87fz4pok2DAKCCAbnLNU74+X7f ntjsvtTIGeSoRnyPBt+jjZWKeeD8GSQXui/LMAFuN7vqa6lpCW/fAhqaOKyEc5hUevho jg9/+OCaCnnoT17G1pksEnU+QUDP/gwSd/tnR6qCeNyeEjeJYla/nBxNUaNJtqNBCeyz HDtfq6iMArHt5vMQ9XzU9A39eiqgYttIKVspK+j9jlQHoyr/pyQskg5DaA7eTCOSfrWy ZesONWSIMHDhWo5LSf3vBbuUa/v2LnhLN6zuHg2vUqy2UOyS5l5YpSDgLRgn9JyipupH 9qmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kpCHUT6c9swYOgw26ak8qxJeq6HYz5et5h+gs7NJPKA=; b=tnE+IdV3D/rHh7eq8Upxhe0NrHuj7YxPutVyBfMnQ7pIwZeOLL/0mTZ4Le04XgHaMk x658h3VwEdihv1mkMqJ9JH4EY3S/GgNHfUGbmdKJ0v+yh2OIa6DGr4/fz9lT7lxoJbw4 dWLVhZKIWsy1TFZcMR3XYOP0Gh2f8uHHRVS3Q8pebBfIXgKRloFkIvJKGb7tIMAQHhyR IQw/G2htRj3yzaPSc5GlYVvJxFASgKLzymGyA0AoHLUfti9fpg3CgAFmmdYq2PN1IZDO 8R4Qj/FkAULZjBGoG4kcQnhiZrBb/xHg32bzVCs6AbtnS3AtbPtLekzrfibkkjLQ7K1h 9stA== X-Gm-Message-State: AOAM531EsYf0I7Uy8QucnzL8dfR47DpwqbfuAUDQTJGptUw7ph/vhd8c +v+ZlQMRqqRakL1VRl75wZM= X-Google-Smtp-Source: ABdhPJxiu1e1mfEjmpGY9T/08ixJylFPkpHAoyhC328BJPZo4h9Kezz/WGvp4lJ1l5n+X7Th7zdDdw== X-Received: by 2002:a54:4818:: with SMTP id j24mr3785764oij.150.1633457984522; Tue, 05 Oct 2021 11:19:44 -0700 (PDT) Received: from nuclearis3.gtech (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id g12sm3557556oof.6.2021.10.05.11.19.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 11:19:44 -0700 (PDT) Subject: Re: [PATCH v5 04/29] spl: cypto: Bring back SPL_ versions of SHA To: Simon Glass , U-Boot Mailing List Cc: Andre Przywara , Rasmus Villemoes , Robert Marko , Masahiro Yamada , Tom Rini References: <20210926014342.127913-1-sjg@chromium.org> <20210926014342.127913-4-sjg@chromium.org> From: "Alex G." Message-ID: Date: Tue, 5 Oct 2021 13:19:42 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210926014342.127913-4-sjg@chromium.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 On 9/25/21 8:43 PM, Simon Glass wrote: > 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") Reviewed-by: Alexandru Gagniuc I don't think these ever worked as intended. I had issues disabling SHA1 in SPL before either of the suspect patches were merged. > --- > 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 >