From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: Raymond Mao <raymond.mao@linaro.org>
Cc: u-boot@lists.denx.de, manish.pandey2@arm.com,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Tom Rini <trini@konsulko.com>,
Stefan Bosch <stefan_b@posteo.net>,
Mario Six <mario.six@gdsys.cc>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Michal Simek <michal.simek@amd.com>,
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>,
Simon Glass <sjg@chromium.org>, Peng Fan <peng.fan@nxp.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Sean Anderson <seanga2@gmail.com>,
Leo Yu-Chi Liang <ycliang@andestech.com>,
Sumit Garg <sumit.garg@linaro.org>, Andrew Davis <afd@ti.com>,
Bryan Brattlof <bb@ti.com>,
"Leon M. Busch-George" <leon@georgemail.eu>,
AKASHI Takahiro <akashi.tkhro@gmail.com>,
Alexander Gendin <agendin@matrox.com>,
Jonathan Humphreys <j-humphreys@ti.com>,
Mattijs Korpershoek <mkorpershoek@baylibre.com>,
Paul Barker <paul.barker.ct@bp.renesas.com>,
Marek Vasut <marex@denx.de>,
Oleksandr Suvorov <oleksandr.suvorov@foundries.io>,
Greg Malysa <greg.malysa@timesys.com>,
Kongyang Liu <seashell11234455@gmail.com>,
Jonas Karlman <jonas@kwiboo.se>,
Sughosh Ganu <sughosh.ganu@linaro.org>,
Anand Moon <linux.amoon@gmail.com>
Subject: Re: [PATCH v8 05/27] sha1: Remove sha1 non-watchdog API
Date: Fri, 04 Oct 2024 09:50:50 +0200 [thread overview]
Message-ID: <87msjk5msl.fsf@prevas.dk> (raw)
In-Reply-To: <20241003215112.3103601-6-raymond.mao@linaro.org> (Raymond Mao's message of "Thu, 3 Oct 2024 14:50:18 -0700")
Raymond Mao <raymond.mao@linaro.org> writes:
> We don't need an API specially for non-watchdog since sha1_csum_wd
> supports it by disabling CONFIG_HW_WATCHDOG and CONFIG_WATCHDOG.
> Set 0x10000 as default chunk size for SHA1.
>
I have to say I believe this is a step in the wrong direction. Having
everybody call a function with that _wd suffix is ugly, as is having
them all pass some pre-defined constant. Moreover, nowadays what happens
every chunksize bytes isn't restricted to watchdog handling.
So yes, we don't need an API specially for non-watchdog, but why not
just make sha1_csum() be the interface to call, and let the "maybe we
need to call schedule() once in a while" be an implementation detail of
sha1_csum().
The same as with our zlib implementaion; we don't have a separate _wd
set of routines, we've just hooked schedule() into the main loop of that
inflate algorithm.
Also, I think the IS_ENABLED(CONFIG_HW_WATCHDOG) || IS_ENABLED(CONFIG_WATCHDOG)
guards are wrong and shouldn't be copy-pasted to new code. Preferably,
the code shouldn't even have any ifdefs, but just always be built as a
loop with the (possibly no-op) schedule() every xxx bytes.
I just sent a series which is the beginning of cleaning up the
CONFIG_HW_WATCHDOG/CONFIG_WATCHDOG/CONFIG_CYCLIC/when is schedule
defined and when should it be called.
Rasmus
next prev parent reply other threads:[~2024-10-04 12:47 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-03 21:50 [PATCH v8 00/27] Integrate MbedTLS v3.6 LTS with U-Boot Raymond Mao
2024-10-03 21:50 ` [PATCH v8 01/27] CI: Exclude MbedTLS subtree for CONFIG checks Raymond Mao
2024-10-09 1:52 ` Simon Glass
2024-10-03 21:50 ` [PATCH v8 02/27] mbedtls: add mbedtls into the build system Raymond Mao
2024-10-09 10:13 ` Ilias Apalodimas
2024-10-11 19:00 ` Raymond Mao
2024-10-03 21:50 ` [PATCH v8 03/27] lib: Adapt digest header files to MbedTLS Raymond Mao
2024-10-09 14:38 ` Tom Rini
2024-10-09 15:32 ` Raymond Mao
2024-10-09 15:41 ` Tom Rini
2024-10-09 17:32 ` Ilias Apalodimas
2024-10-09 17:52 ` Tom Rini
2024-10-10 6:47 ` Ilias Apalodimas
2024-10-11 18:25 ` Raymond Mao
2024-10-11 21:59 ` Tom Rini
2024-10-03 21:50 ` [PATCH v8 04/27] md5: Remove md5 non-watchdog API Raymond Mao
2024-10-03 21:50 ` [PATCH v8 05/27] sha1: Remove sha1 " Raymond Mao
2024-10-04 7:50 ` Rasmus Villemoes [this message]
2024-10-04 15:24 ` Raymond Mao
2024-10-09 2:09 ` Tom Rini
2024-10-03 21:50 ` [PATCH v8 06/27] mbedtls: add digest shim layer for MbedTLS Raymond Mao
2024-10-09 9:15 ` Ilias Apalodimas
2024-10-03 21:50 ` [PATCH v8 07/27] mbedtls: Enable smaller implementation for SHA256/512 Raymond Mao
2024-10-14 18:01 ` Ilias Apalodimas
2024-10-03 21:50 ` [PATCH v8 08/27] mbedtls/external: support Microsoft Authentication Code Raymond Mao
2024-10-03 21:50 ` [PATCH v8 09/27] mbedtls/external: support PKCS9 Authenticate Attributes Raymond Mao
2024-10-03 21:50 ` [PATCH v8 10/27] mbedtls/external: support decoding multiple signer's cert Raymond Mao
2024-10-09 9:15 ` Ilias Apalodimas
2024-10-03 21:50 ` [PATCH v8 11/27] mbedtls/external: update MbedTLS PKCS7 test suites Raymond Mao
2024-10-03 21:50 ` [PATCH v8 12/27] public_key: move common functions to public key helper Raymond Mao
2024-10-03 21:50 ` [PATCH v8 13/27] x509: move common functions to x509 helper Raymond Mao
2024-10-03 21:50 ` [PATCH v8 14/27] pkcs7: move common functions to PKCS7 helper Raymond Mao
2024-10-03 21:50 ` [PATCH v8 15/27] mbedtls: add public key porting layer Raymond Mao
2024-10-03 21:50 ` [PATCH v8 16/27] lib/crypto: Adapt public_key header with MbedTLS Raymond Mao
2024-10-09 9:19 ` Ilias Apalodimas
2024-10-03 21:50 ` [PATCH v8 17/27] mbedtls: add X509 cert parser porting layer Raymond Mao
2024-10-09 9:16 ` Ilias Apalodimas
2024-10-03 21:50 ` [PATCH v8 18/27] lib/crypto: Adapt x509_cert_parser to MbedTLS Raymond Mao
2024-10-03 21:50 ` [PATCH v8 19/27] mbedtls: add PKCS7 parser porting layer Raymond Mao
2024-10-14 18:06 ` Ilias Apalodimas
2024-10-03 21:50 ` [PATCH v8 20/27] lib/crypto: Adapt PKCS7 parser to MbedTLS Raymond Mao
2024-10-09 9:19 ` Ilias Apalodimas
2024-10-03 21:50 ` [PATCH v8 21/27] mbedtls: add MSCode parser porting layer Raymond Mao
2024-10-03 21:50 ` [PATCH v8 22/27] lib/crypto: Adapt mscode_parser to MbedTLS Raymond Mao
2024-10-09 9:18 ` Ilias Apalodimas
2024-10-03 21:50 ` [PATCH v8 23/27] mbedtls: add RSA helper layer on MbedTLS Raymond Mao
2024-10-03 21:50 ` [PATCH v8 24/27] lib/rypto: Adapt rsa_helper to MbedTLS Raymond Mao
2024-10-03 21:50 ` [PATCH v8 25/27] asn1_decoder: add build options for ASN1 decoder Raymond Mao
2024-10-03 21:50 ` [PATCH v8 26/27] test: Remove ASN1 library test Raymond Mao
2024-10-03 21:50 ` [PATCH v8 27/27] configs: enable MbedTLS as default setting Raymond Mao
2024-10-09 1:52 ` [PATCH v8 00/27] Integrate MbedTLS v3.6 LTS with U-Boot Simon Glass
2024-10-09 9:49 ` Ilias Apalodimas
2024-10-09 15:08 ` Raymond Mao
2024-10-15 4:30 ` Tom Rini
2024-10-15 5:22 ` Ilias Apalodimas
2024-10-15 14:08 ` Raymond Mao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87msjk5msl.fsf@prevas.dk \
--to=rasmus.villemoes@prevas.dk \
--cc=afd@ti.com \
--cc=agendin@matrox.com \
--cc=akashi.tkhro@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bb@ti.com \
--cc=greg.malysa@timesys.com \
--cc=ilias.apalodimas@linaro.org \
--cc=j-humphreys@ti.com \
--cc=jh80.chung@samsung.com \
--cc=jiaxun.yang@flygoat.com \
--cc=jonas@kwiboo.se \
--cc=leon@georgemail.eu \
--cc=linux.amoon@gmail.com \
--cc=manish.pandey2@arm.com \
--cc=marex@denx.de \
--cc=mario.six@gdsys.cc \
--cc=michal.simek@amd.com \
--cc=mkorpershoek@baylibre.com \
--cc=oleksandr.suvorov@foundries.io \
--cc=paul.barker.ct@bp.renesas.com \
--cc=peng.fan@nxp.com \
--cc=raymond.mao@linaro.org \
--cc=seanga2@gmail.com \
--cc=seashell11234455@gmail.com \
--cc=sjg@chromium.org \
--cc=stefan_b@posteo.net \
--cc=sughosh.ganu@linaro.org \
--cc=sumit.garg@linaro.org \
--cc=trini@konsulko.com \
--cc=tuomas.tynkkynen@iki.fi \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
--cc=ycliang@andestech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.