botan icon indicating copy to clipboard operation
botan copied to clipboard

Feature request: add an option to automatically include the appropriate hardware support given the requested modules

Open oviano opened this issue 3 years ago • 1 comments

At the moment, I only want: tls, system_rng, bcrypt.

I am achieving this using --minimized and --enable-modules=tls,system_rng,bcrypt

I do something like this (1)

./configure.py --minimized --enable-modules=tls,system_rng,bcrypt --amalgamation --os=macos --cpu=x86_64 --cc=clang --cc-min-version=13.0 --cc-abi-flags="-arch x86_64" --disable-shared

However, this does not include any hardware accelerated modules, even when the os, cpu, compiler version etc are specified and it would be nice if it did or there was an option to tell it to do so.

At the moment, my workaround is to simply request all hardware accelerated modules like this (2)

./configure.py --minimized --enable-modules=tls,system_rng,bcrypt,aes_armv8,aes_ni,aes_power8,aes_vperm,chacha_avx2,ghash_cpu,ghash_vperm,idea_sse2,processor_rng,,rdrand_rng,rdseed,serpent_avx2,sha1_armv8,sha1_sse2,sha1_x86,sha2_32_armv8,sha2_32_bmi2,sha2_32_x86,sha2_64_bmi2,sha3_bmi2,shacal2_avx2,shacal2_x86,simd,simd_avx2,sm4_armv8,threefish_512_avx2 --amalgamation --os=macos --cpu=x86_64 --cc=clang --cc-min-version=13.0 --cc-abi-flags="-arch x86_64" --disable-shared

I do similarly for other platforms/architectures, and it skips the modules not relevant for the platform, so I can just repeat the list of hardware-specific modules rather than have to manually figure out which ones apply to which target.

I'd like to be able to specify a command line like (1) and have it include the relevant modules so I don't need to list them and be concerned about any that are removed/added/renamed etc (for example, I just tested 3.0 alpha and had to remove rdrand_rng from the list above).

If necessary this could be optional, --enable-hardware-modules or something.

If I've missed a way of already achieving this, then please advise!

oviano avatar Feb 25 '22 10:02 oviano

There currently isn't a mechanism for this but it would be useful to have.

randombit avatar Mar 02 '22 13:03 randombit