From a89255d933d02bb388f9a9fa1093b189f389732d Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 26 Feb 2018 17:26:40 -0500 Subject: Optimize P-256 and P-384 reduction Precompute the multiples of the prime and then subtract directly. --- src/lib/math/bigint/bigint.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib/math/bigint/bigint.h') diff --git a/src/lib/math/bigint/bigint.h b/src/lib/math/bigint/bigint.h index ca35bd07d..6e2f8dbde 100644 --- a/src/lib/math/bigint/bigint.h +++ b/src/lib/math/bigint/bigint.h @@ -480,7 +480,11 @@ class BOTAN_PUBLIC_API(2,0) BigInt final */ void grow_to(size_t n); - void shrink_to_fit(); + /** + * Resize the vector to the minimum word size to hold the integer, or + * min_size words, whichever is larger + */ + void shrink_to_fit(size_t min_size = 0); /** * Fill BigInt with a random number with size of bitsize -- cgit v1.2.3