On Fri, 4 Oct 2019 at 15:57, Jason A. Donenfeld <Jason@xxxxxxxxx> wrote: > > On Wed, Oct 02, 2019 at 04:17:07PM +0200, Ard Biesheuvel wrote: > > - replace .c #includes with Kconfig based object selection > > Cool! > > > +config CRYPTO_ARCH_HAVE_LIB_CURVE25519 > > + tristate > > + > > +config CRYPTO_ARCH_HAVE_LIB_CURVE25519_BASE > > + bool > > + > > +config CRYPTO_LIB_CURVE25519 > > + tristate "Curve25519 scalar multiplication library" > > + depends on CRYPTO_ARCH_HAVE_LIB_CURVE25519 || !CRYPTO_ARCH_HAVE_LIB_CURVE25519 > > a || !a ==> true > > Did you mean for one of these to be _BASE? Or is this a Kconfig trick of > a different variety that's intentional? > This ensures that the base module is not builtin when the arch one is configured as a module, since in that case, the arch code never gets called. > > +libcurve25519-y := curve25519-fiat32.o > > +libcurve25519-$(CONFIG_ARCH_SUPPORTS_INT128) := curve25519-hacl64.o > > Nice idea.