1#ifndef SECP256K1_ECDH_H
2#define SECP256K1_ECDH_H
22 unsigned char *output,
23 const unsigned char *
x32,
24 const unsigned char *
y32,
51 unsigned char *output,
53 const unsigned char *
seckey,
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
#define SECP256K1_ARG_NONNULL(_x)
#define SECP256K1_WARN_UNUSED_RESULT
Warning attributes NONNULL is not used if SECP256K1_BUILD is set to avoid the compiler optimizing out...
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh(const secp256k1_context *ctx, unsigned char *output, const secp256k1_pubkey *pubkey, const unsigned char *seckey, secp256k1_ecdh_hash_function hashfp, void *data) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Compute an EC Diffie-Hellman secret in constant time.
SECP256K1_API const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_function_sha256
An implementation of SHA256 hash function that applies to compressed public key.
int(* secp256k1_ecdh_hash_function)(unsigned char *output, const unsigned char *x32, const unsigned char *y32, void *data)
A pointer to a function that hashes an EC point to obtain an ECDH secret.
SECP256K1_API const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_function_default
A default ECDH hash function (currently equal to secp256k1_ecdh_hash_function_sha256).
Opaque data structure that holds a parsed and valid public key.