aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/bulletproofs.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-02-03 14:36:29 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-09-11 13:37:32 +0000
commitbacf0a1e2ff54ef1fc77e3f6ec92e87946084c1a (patch)
tree6d1ec247c11b7f9759dc0f169f98b5804daad1df /tests/unit_tests/bulletproofs.cpp
parentmake straus cached mode thread safe, and add tests for it (diff)
downloadmonero-bacf0a1e2ff54ef1fc77e3f6ec92e87946084c1a.tar.xz
bulletproofs: add aggregated verification
Ported from sarang's java code
Diffstat (limited to 'tests/unit_tests/bulletproofs.cpp')
-rw-r--r--tests/unit_tests/bulletproofs.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit_tests/bulletproofs.cpp b/tests/unit_tests/bulletproofs.cpp
index 183bb5167..db14c050a 100644
--- a/tests/unit_tests/bulletproofs.cpp
+++ b/tests/unit_tests/bulletproofs.cpp
@@ -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)
{