mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Use a constant for maximum surjection targets
This commit is contained in:
parent
4a44ff2c2e
commit
4940ceeea6
3 changed files with 4 additions and 2 deletions
|
|
@ -192,7 +192,7 @@ bool SurjectOutput(CTxOutWitness& txoutwit, const std::vector<secp256k1_fixed_as
|
|||
{
|
||||
int ret;
|
||||
// 1 to 3 targets
|
||||
size_t nInputsToSelect = std::min((size_t)3, surjection_targets.size());
|
||||
size_t nInputsToSelect = std::min(MAX_SURJECTION_TARGETS, surjection_targets.size());
|
||||
unsigned char randseed[32];
|
||||
GetStrongRandBytes(randseed, 32);
|
||||
size_t input_index;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ static const size_t MAX_RANGEPROOF_SIZE = 5126;
|
|||
static const size_t DEFAULT_SURJECTIONPROOF_SIZE = 135;
|
||||
// 32 bytes of asset type, 32 bytes of asset blinding factor in sidechannel
|
||||
static const size_t SIDECHANNEL_MSG_SIZE = 64;
|
||||
// Maximum number of inputs to select for surjection proof
|
||||
static const size_t MAX_SURJECTION_TARGETS = 3;
|
||||
|
||||
// Blinding context
|
||||
extern secp256k1_context* secp256k1_blind_context;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ bool CreateAssetSurjectionProof(std::vector<unsigned char>& output_proof, const
|
|||
{
|
||||
int ret;
|
||||
// 1 to 3 targets
|
||||
size_t inputs_to_select = std::min((size_t)3, fixed_input_tags.size());
|
||||
size_t inputs_to_select = std::min(MAX_SURJECTION_TARGETS, fixed_input_tags.size());
|
||||
unsigned char randseed[32];
|
||||
GetStrongRandBytes(randseed, 32);
|
||||
size_t input_index;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue