Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/eckey_impl.h
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | if (compressed) { | ||||
pub[0] = SECP256K1_TAG_PUBKEY_UNCOMPRESSED; | pub[0] = SECP256K1_TAG_PUBKEY_UNCOMPRESSED; | ||||
secp256k1_fe_get_b32(&pub[33], &elem->y); | secp256k1_fe_get_b32(&pub[33], &elem->y); | ||||
} | } | ||||
return 1; | return 1; | ||||
} | } | ||||
static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak) { | static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak) { | ||||
secp256k1_scalar_add(key, key, tweak); | secp256k1_scalar_add(key, key, tweak); | ||||
if (secp256k1_scalar_is_zero(key)) { | return !secp256k1_scalar_is_zero(key); | ||||
return 0; | |||||
} | |||||
return 1; | |||||
} | } | ||||
static int secp256k1_eckey_pubkey_tweak_add(const secp256k1_ecmult_context *ctx, secp256k1_ge *key, const secp256k1_scalar *tweak) { | static int secp256k1_eckey_pubkey_tweak_add(const secp256k1_ecmult_context *ctx, secp256k1_ge *key, const secp256k1_scalar *tweak) { | ||||
secp256k1_gej pt; | secp256k1_gej pt; | ||||
secp256k1_scalar one; | secp256k1_scalar one; | ||||
secp256k1_gej_set_ge(&pt, key); | secp256k1_gej_set_ge(&pt, key); | ||||
secp256k1_scalar_set_int(&one, 1); | secp256k1_scalar_set_int(&one, 1); | ||||
secp256k1_ecmult(ctx, &pt, &pt, &one, tweak); | secp256k1_ecmult(ctx, &pt, &pt, &one, tweak); | ||||
Show All 31 Lines |