Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/secp256k1.c
Show First 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | void secp256k1_context_set_error_callback(secp256k1_context* ctx, void (*fun)(const char* message, void* data), const void* data) { | ||||
ctx->error_callback.data = data; | ctx->error_callback.data = data; | ||||
} | } | ||||
secp256k1_scratch_space* secp256k1_scratch_space_create(const secp256k1_context* ctx, 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); | ||||
return secp256k1_scratch_create(&ctx->error_callback, max_size); | return secp256k1_scratch_create(&ctx->error_callback, max_size); | ||||
} | } | ||||
void secp256k1_scratch_space_destroy(secp256k1_scratch_space* scratch) { | void secp256k1_scratch_space_destroy(const secp256k1_context *ctx, secp256k1_scratch_space* scratch) { | ||||
secp256k1_scratch_destroy(scratch); | VERIFY_CHECK(ctx != NULL); | ||||
secp256k1_scratch_destroy(&ctx->error_callback, 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) { | ||||
/* When the secp256k1_ge_storage type is exactly 64 byte, use its | /* When the secp256k1_ge_storage type is exactly 64 byte, use its | ||||
* representation inside secp256k1_pubkey, as conversion is very fast. | * representation inside secp256k1_pubkey, as conversion is very fast. | ||||
* Note that secp256k1_pubkey_save must use the same representation. */ | * Note that secp256k1_pubkey_save must use the same representation. */ | ||||
secp256k1_ge_storage s; | secp256k1_ge_storage s; | ||||
▲ Show 20 Lines • Show All 476 Lines • Show Last 20 Lines |