mirror of
https://github.com/monero-project/monero.git
synced 2025-08-06 09:54:19 -04:00
bulletproofs: add aggregated verification
Ported from sarang's java code
This commit is contained in:
parent
e895c3def1
commit
bacf0a1e2f
11 changed files with 453 additions and 259 deletions
|
@ -135,6 +135,25 @@ TEST(bulletproofs, multi_splitting)
|
|||
}
|
||||
}
|
||||
|
||||
TEST(bulletproofs, valid_aggregated)
|
||||
{
|
||||
static const size_t N_PROOFS = 8;
|
||||
std::vector<rct::Bulletproof> proofs(N_PROOFS);
|
||||
for (size_t n = 0; n < N_PROOFS; ++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());
|
||||
}
|
||||
proofs[n] = bulletproof_PROVE(amounts, gamma);
|
||||
}
|
||||
ASSERT_TRUE(rct::bulletproof_VERIFY(proofs));
|
||||
}
|
||||
|
||||
|
||||
TEST(bulletproofs, invalid_8)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue