From: Matt Corallo Date: Thu, 1 Aug 2024 21:36:35 +0000 (+0000) Subject: Use Karatsuba mul less when built with `slower_smaller_binary` X-Git-Tag: v0.6.5~1 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=ab08e2c306962f639cc956c64151e807ba53a53a;p=dnssec-prover Use Karatsuba mul less when built with `slower_smaller_binary` This is a less than 5% reduction in performance and reduces code size for the crypto module from 26.7KiB to 26.5KiB. --- diff --git a/src/crypto/bigint.rs b/src/crypto/bigint.rs index 8986869..1955775 100644 --- a/src/crypto/bigint.rs +++ b/src/crypto/bigint.rs @@ -431,7 +431,13 @@ macro_rules! define_mul { ($name: ident, $len: expr, $submul: ident) => { define_gradeschool_mul!(mul_4, 4, mul_2); #[cfg(not(feature = "slower_smaller_binary"))] define_gradeschool_mul!(mul_6, 6, mul_3); + +#[cfg(not(feature = "slower_smaller_binary"))] define_mul!(mul_8, 8, mul_4); + +#[cfg(feature = "slower_smaller_binary")] +define_gradeschool_mul!(mul_8, 8, mul_4); + define_mul!(mul_16, 16, mul_8); define_mul!(mul_32, 32, mul_16); define_mul!(mul_64, 64, mul_32);