mirror of
https://github.com/monero-project/monero.git
synced 2025-05-08 18:15:05 -04:00
bulletproofs: multi-output bulletproofs
This commit is contained in:
parent
cb1cc757ba
commit
aacfd6e370
4 changed files with 339 additions and 32 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue