aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-04-02 15:09:10 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-09-11 13:37:40 +0000
commit3011178021690d31e031ed66ed56d5a7300005d2 (patch)
tree09f45befa33ded874265161229ff556b4e4189a6
parentrequire canonical multi output bulletproof layout (diff)
downloadmonero-3011178021690d31e031ed66ed56d5a7300005d2.tar.xz
unit_tests: a couple more bulletproof unit tests for gamma
-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));
+}