Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/modules/extrakeys/main_impl.h
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | int secp256k1_keypair_create(const secp256k1_context* ctx, secp256k1_keypair *keypair, const unsigned char *seckey32) { | ||||
VERIFY_CHECK(ctx != NULL); | VERIFY_CHECK(ctx != NULL); | ||||
ARG_CHECK(keypair != NULL); | ARG_CHECK(keypair != NULL); | ||||
memset(keypair, 0, sizeof(*keypair)); | memset(keypair, 0, sizeof(*keypair)); | ||||
ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx)); | ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx)); | ||||
ARG_CHECK(seckey32 != NULL); | ARG_CHECK(seckey32 != NULL); | ||||
ret = secp256k1_ec_pubkey_create_helper(&ctx->ecmult_gen_ctx, &sk, &pk, seckey32); | ret = secp256k1_ec_pubkey_create_helper(&ctx->ecmult_gen_ctx, &sk, &pk, seckey32); | ||||
secp256k1_keypair_save(keypair, &sk, &pk); | secp256k1_keypair_save(keypair, &sk, &pk); | ||||
memczero(keypair, sizeof(*keypair), !ret); | secp256k1_memczero(keypair, sizeof(*keypair), !ret); | ||||
secp256k1_scalar_clear(&sk); | secp256k1_scalar_clear(&sk); | ||||
return ret; | return ret; | ||||
} | } | ||||
int secp256k1_keypair_pub(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const secp256k1_keypair *keypair) { | int secp256k1_keypair_pub(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const secp256k1_keypair *keypair) { | ||||
VERIFY_CHECK(ctx != NULL); | VERIFY_CHECK(ctx != NULL); | ||||
ARG_CHECK(pubkey != NULL); | ARG_CHECK(pubkey != NULL); | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |