unit_tests: a couple more bulletproof unit tests for gamma

This commit is contained in:
moneromooo-monero 2018-04-02 15:09:10 +01:00
parent c444b1b229
commit 3011178021
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -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));
}