Skip to content

Commit

Permalink
Add a define for the max number of bulletproof multi-outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
moneromooo-monero committed Sep 11, 2018
1 parent 2a8fcb4 commit 7e67c52
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/cryptonote_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@

#define DEFAULT_TXPOOL_MAX_SIZE 648000000ull // 3 days at 300000, in bytes

#define BULLETPROOF_MAX_OUTPUTS 16

// New constants are intended to go here
namespace config
{
Expand Down
3 changes: 2 additions & 1 deletion src/ringct/bulletproofs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <boost/thread/mutex.hpp>
#include "misc_log_ex.h"
#include "common/perf_timer.h"
#include "cryptonote_config.h"
extern "C"
{
#include "crypto/crypto-ops.h"
Expand All @@ -57,7 +58,7 @@ static rct::keyV vector_dup(const rct::key &x, size_t n);
static rct::key inner_product(const rct::keyV &a, const rct::keyV &b);

static constexpr size_t maxN = 64;
static constexpr size_t maxM = 16;
static constexpr size_t maxM = BULLETPROOF_MAX_OUTPUTS;
static rct::key Hi[maxN*maxM], Gi[maxN*maxM];
static ge_p3 Hi_p3[maxN*maxM], Gi_p3[maxN*maxM];
static ge_dsmp Gprecomp[maxN*maxM], Hprecomp[maxN*maxM];
Expand Down
2 changes: 1 addition & 1 deletion src/ringct/rctSigs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ namespace rct {
{
size_t batch_size = 1;
if (range_proof_type == RangeProofMultiOutputBulletproof)
while (batch_size * 2 + amounts_proved <= n_amounts && batch_size * 2 <= 16)
while (batch_size * 2 + amounts_proved <= n_amounts && batch_size * 2 <= BULLETPROOF_MAX_OUTPUTS)
batch_size *= 2;
rct::keyV C, masks;
std::vector<uint64_t> batch_amounts(batch_size);
Expand Down

0 comments on commit 7e67c52

Please sign in to comment.