Bump secp256k1 subtree
[bitcoinplatinum.git] / src / secp256k1 / include / secp256k1_ecdh.h
blob88492dc1a40bcf4f907a97c88d892d9e9122107d
1 #ifndef SECP256K1_ECDH_H
2 #define SECP256K1_ECDH_H
4 #include "secp256k1.h"
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
10 /** Compute an EC Diffie-Hellman secret in constant time
11 * Returns: 1: exponentiation was successful
12 * 0: scalar was invalid (zero or overflow)
13 * Args: ctx: pointer to a context object (cannot be NULL)
14 * Out: result: a 32-byte array which will be populated by an ECDH
15 * secret computed from the point and scalar
16 * In: pubkey: a pointer to a secp256k1_pubkey containing an
17 * initialized public key
18 * privkey: a 32-byte scalar with which to multiply the point
20 SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh(
21 const secp256k1_context* ctx,
22 unsigned char *result,
23 const secp256k1_pubkey *pubkey,
24 const unsigned char *privkey
25 ) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
27 #ifdef __cplusplus
29 #endif
31 #endif /* SECP256K1_ECDH_H */