Get rid of precomputed H tables (Pieter Wuille)
This commit is contained in:
@@ -57,10 +57,6 @@ static const secp256k1_callback default_error_callback = {
|
||||
struct secp256k1_context_struct {
|
||||
secp256k1_ecmult_context ecmult_ctx;
|
||||
secp256k1_ecmult_gen_context ecmult_gen_ctx;
|
||||
#ifdef ENABLE_MODULE_RANGEPROOF
|
||||
secp256k1_pedersen_context pedersen_ctx;
|
||||
secp256k1_rangeproof_context rangeproof_ctx;
|
||||
#endif
|
||||
secp256k1_callback illegal_callback;
|
||||
secp256k1_callback error_callback;
|
||||
};
|
||||
@@ -87,10 +83,6 @@ secp256k1_context* secp256k1_context_create(unsigned int flags) {
|
||||
|
||||
secp256k1_ecmult_context_init(&ret->ecmult_ctx);
|
||||
secp256k1_ecmult_gen_context_init(&ret->ecmult_gen_ctx);
|
||||
#ifdef ENABLE_MODULE_RANGEPROOF
|
||||
secp256k1_pedersen_context_init(&ret->pedersen_ctx);
|
||||
secp256k1_rangeproof_context_init(&ret->rangeproof_ctx);
|
||||
#endif
|
||||
|
||||
if (flags & SECP256K1_FLAGS_BIT_CONTEXT_SIGN) {
|
||||
secp256k1_ecmult_gen_context_build(&ret->ecmult_gen_ctx, &ret->error_callback);
|
||||
@@ -108,10 +100,6 @@ secp256k1_context* secp256k1_context_clone(const secp256k1_context* ctx) {
|
||||
ret->error_callback = ctx->error_callback;
|
||||
secp256k1_ecmult_context_clone(&ret->ecmult_ctx, &ctx->ecmult_ctx, &ctx->error_callback);
|
||||
secp256k1_ecmult_gen_context_clone(&ret->ecmult_gen_ctx, &ctx->ecmult_gen_ctx, &ctx->error_callback);
|
||||
#ifdef ENABLE_MODULE_RANGEPROOF
|
||||
secp256k1_pedersen_context_clone(&ret->pedersen_ctx, &ctx->pedersen_ctx, &ctx->error_callback);
|
||||
secp256k1_rangeproof_context_clone(&ret->rangeproof_ctx, &ctx->rangeproof_ctx, &ctx->error_callback);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -120,10 +108,6 @@ void secp256k1_context_destroy(secp256k1_context* ctx) {
|
||||
if (ctx != NULL) {
|
||||
secp256k1_ecmult_context_clear(&ctx->ecmult_ctx);
|
||||
secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx);
|
||||
#ifdef ENABLE_MODULE_RANGEPROOF
|
||||
secp256k1_pedersen_context_clear(&ctx->pedersen_ctx);
|
||||
secp256k1_rangeproof_context_clear(&ctx->rangeproof_ctx);
|
||||
#endif
|
||||
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user