On Fri, Oct 04, 2024 at 11:24:28AM -0400, Raymond Mao wrote: > Hi Rasmus, > > On Fri, 4 Oct 2024 at 03:50, Rasmus Villemoes <[email protected]> > wrote: > > > Raymond Mao <[email protected]> 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. > > > The reason I keep the ` _csum_wd()` one is to align to other hash APIs > currently we have. > For MD5, SHA256, SHA512, we only have `_csum_wd()` but no `_csum()` - SHA1 > is a > special one due to the historical problem I guess. > The minimum refactoring I did here is to unify the interface and make it > adaptable to the > MbedTLS library I introduced with this series. > Yes, I agree some optimizations or refactoring are needed for the hash APIs, > but I will prefer to do this in a new series other than increasing the > scope of this patch set.
I agree this should be the target of near-future follow-up work rather than gating for the series. -- Tom
signature.asc
Description: PGP signature

