diff options
author | Jack Lloyd <[email protected]> | 2018-04-23 19:01:51 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-04-23 19:33:06 -0400 |
commit | d1479ede7bc01b60f67d6826611baf43987e941b (patch) | |
tree | 86deee3c166871aa58039c857196f2ef6be6b5e9 /src/lib/math/bigint/bigint.h | |
parent | c90d868a533c13501e8d6e3b71919501b9d70f9e (diff) |
Add BigInt::mod_sub
Diffstat (limited to 'src/lib/math/bigint/bigint.h')
-rw-r--r-- | src/lib/math/bigint/bigint.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/math/bigint/bigint.h b/src/lib/math/bigint/bigint.h index eec7f6176..bb7a69541 100644 --- a/src/lib/math/bigint/bigint.h +++ b/src/lib/math/bigint/bigint.h @@ -266,6 +266,22 @@ class BOTAN_PUBLIC_API(2,0) BigInt final BigInt& rev_sub(const word y[], size_t y_size, secure_vector<word>& ws); /** + * Set *this to (*this + y) % mod + * @param y the BigInt to add - assumed y >= 0 and y < mod + * @param mod the positive modulus + * @param ws a temp workspace + */ + BigInt& mod_add(const BigInt& y, const BigInt& mod, secure_vector<word>& ws); + + /** + * Set *this to (*this - y) % mod + * @param y the BigInt to subtract - assumed y >= 0 and y < mod + * @param mod the positive modulus + * @param ws a temp workspace + */ + BigInt& mod_sub(const BigInt& y, const BigInt& mod, secure_vector<word>& ws); + + /** * Return *this below mod * * Assumes that *this is (if anything) only slightly larger than |