aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_bigint.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-02-21 11:44:50 -0500
committerJack Lloyd <[email protected]>2016-02-21 11:44:50 -0500
commit410474253fd491c21c4a69d1352325136416d675 (patch)
treea1f678e06a3cbdeabf0b826f2184ff5977d36478 /src/tests/test_bigint.cpp
parent30edf16ca6fabc22f47e10b18cb1fafb62ad5a82 (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.cpp11
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;
}
};