aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_tests')
-rw-r--r--tests/unit_tests/bulletproofs.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit_tests/bulletproofs.cpp b/tests/unit_tests/bulletproofs.cpp
index 077e02d5f..f163f7a20 100644
--- a/tests/unit_tests/bulletproofs.cpp
+++ b/tests/unit_tests/bulletproofs.cpp
@@ -174,3 +174,22 @@ TEST(bulletproofs, invalid_31)
rct::Bulletproof proof = bulletproof_PROVE(invalid_amount, rct::skGen());
ASSERT_FALSE(rct::bulletproof_VERIFY(proof));
}
+
+TEST(bulletproofs, invalid_gamma_0)
+{
+ rct::key invalid_amount = rct::zero();
+ invalid_amount[8] = 1;
+ rct::key gamma = rct::zero();
+ rct::Bulletproof proof = bulletproof_PROVE(invalid_amount, gamma);
+ ASSERT_FALSE(rct::bulletproof_VERIFY(proof));
+}
+
+TEST(bulletproofs, invalid_gamma_ff)
+{
+ rct::key invalid_amount = rct::zero();
+ invalid_amount[8] = 1;
+ rct::key gamma = rct::zero();
+ memset(&gamma, 0xff, sizeof(gamma));
+ rct::Bulletproof proof = bulletproof_PROVE(invalid_amount, gamma);
+ ASSERT_FALSE(rct::bulletproof_VERIFY(proof));
+}