[lkml]   [2022]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2 3/3] crypto: lib - move crypto_simd_disabled_for_test into utils
On Sat, Jul 16, 2022 at 08:32:55PM +0200, Jason A. Donenfeld wrote:
> Hi Eric,
> On Fri, Jul 15, 2022 at 11:29:20PM -0700, Eric Biggers wrote:
> > From: Eric Biggers <>
> >
> > Move the definition of crypto_simd_disabled_for_test into
> > lib/crypto/utils.c so that it can be accessed by library code.
> >
> > This is needed when code that is shared between a traditional crypto API
> > implementation and a library implementation is built-in, but
> > CRYPTO_ALGAPI=m. The x86 blake2s previously was an example of this
> > (
> > Although that case was resolved by removing the blake2s shash support,
> > this problem could easily come back in the future, so let's address it.
> I'm not sure I see the reason in general for a utility library rather
> than doing these piecemeal like the rest of lib functions. Why is crypto
> special here? But in particular to this patch: nothing is actually using
> crypto_simd_disabled_for_test in lib/crypto, right? So is this
> necessary?

Well, this is what Herbert wanted: It's
subjective, but for now I think I prefer this approach too, since the utility
functions are so small and are widely used. A whole module is overkill for just
a few lines of code.

The commit message answers your second and third questions.

- Eric

 \ /
  Last update: 2022-07-19 06:35    [W:3.694 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site