diff options
author | Jack Lloyd <[email protected]> | 2016-02-21 11:44:50 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-02-21 11:44:50 -0500 |
commit | 410474253fd491c21c4a69d1352325136416d675 (patch) | |
tree | a1f678e06a3cbdeabf0b826f2184ff5977d36478 /src/tests/test_bigint.cpp | |
parent | 30edf16ca6fabc22f47e10b18cb1fafb62ad5a82 (diff) |
Add more tests for modular inverse
The result of fuzzing with AFL for a while, then running cmin on the
result.
Diffstat (limited to 'src/tests/test_bigint.cpp')
-rw-r--r-- | src/tests/test_bigint.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/tests/test_bigint.cpp b/src/tests/test_bigint.cpp index 1a615c374..95ce8be08 100644 --- a/src/tests/test_bigint.cpp +++ b/src/tests/test_bigint.cpp @@ -453,15 +453,18 @@ class BigInt_InvMod_Test : public Text_Based_Test if(mod.is_odd()) { - result.test_eq("normalized_montgomery_inverse", - normalized_montgomery_inverse(a, mod), - expected); - result.test_eq("ct_inverse_odd_modulus", ct_inverse_mod_odd_modulus(a, mod), expected); } + if(mod.is_odd() && a_inv != 0) + { + result.test_eq("normalized_montgomery_inverse", + normalized_montgomery_inverse(a, mod), + expected); + } + return result; } }; |