Skip to content

Commit

Permalink
unit_tests: a couple more bulletproof unit tests for gamma
Browse files Browse the repository at this point in the history
  • Loading branch information
moneromooo-monero committed Sep 11, 2018
1 parent c444b1b commit 3011178
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/unit_tests/bulletproofs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

0 comments on commit 3011178

Please sign in to comment.