bulletproofs: multi-output bulletproofs

This commit is contained in:
moneromooo-monero 2018-01-03 21:37:18 +00:00
parent cb1cc757ba
commit aacfd6e370
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
4 changed files with 339 additions and 32 deletions

View file

@ -32,6 +32,7 @@
#include "ringct/rctOps.h"
#include "ringct/bulletproofs.h"
#include "misc_log_ex.h"
TEST(bulletproofs, valid_zero)
{
@ -54,6 +55,24 @@ TEST(bulletproofs, valid_random)
}
}
TEST(bulletproofs, valid_multi_random)
{
for (int n = 0; n < 8; ++n)
{
size_t outputs = 2 + n;
std::vector<uint64_t> amounts;
rct::keyV gamma;
for (size_t i = 0; i < outputs; ++i)
{
amounts.push_back(crypto::rand<uint64_t>());
gamma.push_back(rct::skGen());
}
rct::Bulletproof proof = bulletproof_PROVE(amounts, gamma);
ASSERT_TRUE(rct::bulletproof_VERIFY(proof));
}
}
TEST(bulletproofs, invalid_8)
{
rct::key invalid_amount = rct::zero();