whitelist: fix SECP256K1_WHITELIST_MAX_N_KEYS constant
"MAX" should mean inclusive. And the whitelisting functions handled this inconsistently.
This commit is contained in:
parent
e290c0f835
commit
c8ac14d9dc
@ -13,7 +13,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SECP256K1_WHITELIST_MAX_N_KEYS 256
|
||||
#define SECP256K1_WHITELIST_MAX_N_KEYS 255
|
||||
|
||||
/** Opaque data structure that holds a parsed whitelist proof
|
||||
*
|
||||
|
@ -144,7 +144,7 @@ int secp256k1_whitelist_signature_parse(const secp256k1_context* ctx, secp256k1_
|
||||
}
|
||||
|
||||
sig->n_keys = input[0];
|
||||
if (sig->n_keys >= MAX_KEYS || input_len != 1 + 32 * (sig->n_keys + 1)) {
|
||||
if (sig->n_keys > MAX_KEYS || input_len != 1 + 32 * (sig->n_keys + 1)) {
|
||||
return 0;
|
||||
}
|
||||
memcpy(&sig->data[0], &input[1], 32 * (sig->n_keys + 1));
|
||||
|
Loading…
x
Reference in New Issue
Block a user