47 secp256k1_pubkey_load(ctx, &pt,
point);
48 secp256k1_scalar_set_b32(&
s, scalar, &
overflow);
51 secp256k1_scalar_cmov(&
s, &secp256k1_scalar_one,
overflow);
53 secp256k1_ecmult_const(&res, &pt, &
s, 256);
54 secp256k1_ge_set_gej(&pt, &res);
57 secp256k1_fe_normalize(&pt.
x);
58 secp256k1_fe_normalize(&pt.
y);
59 secp256k1_fe_get_b32(x, &pt.
x);
60 secp256k1_fe_get_b32(y, &pt.
y);
62 ret = hashfp(output, x, y, data);
66 secp256k1_scalar_clear(&
s);
const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_function_sha256
int secp256k1_ecdh(const secp256k1_context *ctx, unsigned char *output, const secp256k1_pubkey *point, const unsigned char *scalar, secp256k1_ecdh_hash_function hashfp, void *data)
const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_function_default