Skip to content

Commit

Permalink
Merge pull request bitcoin#28
Browse files Browse the repository at this point in the history
4d79beb Do not free endomorphism constants when disabled (Pieter Wuille)
  • Loading branch information
sipa committed Jun 20, 2014
2 parents ebfa43b + 4d79beb commit e65183a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ typedef struct {
secp256k1_num_t half_order; // half the order of the curve (= order of its generator)
secp256k1_ge_t g; // the generator point

#ifdef USE_ENDOMORPHISM
// constants related to secp256k1's efficiently computable endomorphism
secp256k1_fe_t beta;
secp256k1_num_t lambda, a1b2, b1, a2;
#endif
} secp256k1_ge_consts_t;

static const secp256k1_ge_consts_t *secp256k1_ge_consts = NULL;
Expand Down
2 changes: 2 additions & 0 deletions src/group_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,12 @@ void static secp256k1_ge_stop(void) {
secp256k1_ge_consts_t *c = (secp256k1_ge_consts_t*)secp256k1_ge_consts;
secp256k1_num_free(&c->order);
secp256k1_num_free(&c->half_order);
#ifdef USE_ENDOMORPHISM
secp256k1_num_free(&c->lambda);
secp256k1_num_free(&c->a1b2);
secp256k1_num_free(&c->a2);
secp256k1_num_free(&c->b1);
#endif
free((void*)c);
secp256k1_ge_consts = NULL;
}
Expand Down

0 comments on commit e65183a

Please sign in to comment.