mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
Merge pull request #28
4d79beb
Do not free endomorphism constants when disabled (Pieter Wuille)
This commit is contained in:
commit
e65183ae54
2 changed files with 4 additions and 0 deletions
|
@ -29,9 +29,11 @@ typedef struct {
|
||||||
secp256k1_num_t half_order; // half the order of the curve (= order of its generator)
|
secp256k1_num_t half_order; // half the order of the curve (= order of its generator)
|
||||||
secp256k1_ge_t g; // the generator point
|
secp256k1_ge_t g; // the generator point
|
||||||
|
|
||||||
|
#ifdef USE_ENDOMORPHISM
|
||||||
// constants related to secp256k1's efficiently computable endomorphism
|
// constants related to secp256k1's efficiently computable endomorphism
|
||||||
secp256k1_fe_t beta;
|
secp256k1_fe_t beta;
|
||||||
secp256k1_num_t lambda, a1b2, b1, a2;
|
secp256k1_num_t lambda, a1b2, b1, a2;
|
||||||
|
#endif
|
||||||
} secp256k1_ge_consts_t;
|
} secp256k1_ge_consts_t;
|
||||||
|
|
||||||
static const secp256k1_ge_consts_t *secp256k1_ge_consts = NULL;
|
static const secp256k1_ge_consts_t *secp256k1_ge_consts = NULL;
|
||||||
|
|
|
@ -393,10 +393,12 @@ void static secp256k1_ge_stop(void) {
|
||||||
secp256k1_ge_consts_t *c = (secp256k1_ge_consts_t*)secp256k1_ge_consts;
|
secp256k1_ge_consts_t *c = (secp256k1_ge_consts_t*)secp256k1_ge_consts;
|
||||||
secp256k1_num_free(&c->order);
|
secp256k1_num_free(&c->order);
|
||||||
secp256k1_num_free(&c->half_order);
|
secp256k1_num_free(&c->half_order);
|
||||||
|
#ifdef USE_ENDOMORPHISM
|
||||||
secp256k1_num_free(&c->lambda);
|
secp256k1_num_free(&c->lambda);
|
||||||
secp256k1_num_free(&c->a1b2);
|
secp256k1_num_free(&c->a1b2);
|
||||||
secp256k1_num_free(&c->a2);
|
secp256k1_num_free(&c->a2);
|
||||||
secp256k1_num_free(&c->b1);
|
secp256k1_num_free(&c->b1);
|
||||||
|
#endif
|
||||||
free((void*)c);
|
free((void*)c);
|
||||||
secp256k1_ge_consts = NULL;
|
secp256k1_ge_consts = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue