Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/secp256k1.c
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | |||||
void secp256k1_context_set_error_callback(secp256k1_context* ctx, void (*fun)(const char* message, void* data), const void* data) { | void secp256k1_context_set_error_callback(secp256k1_context* ctx, void (*fun)(const char* message, void* data), const void* data) { | ||||
if (fun == NULL) { | if (fun == NULL) { | ||||
fun = default_error_callback_fn; | fun = default_error_callback_fn; | ||||
} | } | ||||
ctx->error_callback.fn = fun; | ctx->error_callback.fn = fun; | ||||
ctx->error_callback.data = data; | ctx->error_callback.data = data; | ||||
} | } | ||||
secp256k1_scratch_space* secp256k1_scratch_space_create(const secp256k1_context* ctx, size_t init_size, size_t max_size) { | secp256k1_scratch_space* secp256k1_scratch_space_create(const secp256k1_context* ctx, size_t max_size) { | ||||
VERIFY_CHECK(ctx != NULL); | VERIFY_CHECK(ctx != NULL); | ||||
ARG_CHECK(max_size >= init_size); | return secp256k1_scratch_create(&ctx->error_callback, max_size); | ||||
return secp256k1_scratch_create(&ctx->error_callback, init_size, max_size); | |||||
} | } | ||||
void secp256k1_scratch_space_destroy(secp256k1_scratch_space* scratch) { | void secp256k1_scratch_space_destroy(secp256k1_scratch_space* scratch) { | ||||
secp256k1_scratch_destroy(scratch); | secp256k1_scratch_destroy(scratch); | ||||
} | } | ||||
static int secp256k1_pubkey_load(const secp256k1_context* ctx, secp256k1_ge* ge, const secp256k1_pubkey* pubkey) { | static int secp256k1_pubkey_load(const secp256k1_context* ctx, secp256k1_ge* ge, const secp256k1_pubkey* pubkey) { | ||||
if (sizeof(secp256k1_ge_storage) == 64) { | if (sizeof(secp256k1_ge_storage) == 64) { | ||||
▲ Show 20 Lines • Show All 478 Lines • Show Last 20 Lines |