github.com/ethereumproject/go-ethereum@v5.5.2+incompatible/crypto/secp256k1/libsecp256k1/include/secp256k1_ecdh.h (about) 1 #ifndef _SECP256K1_ECDH_ 2 # define _SECP256K1_ECDH_ 3 4 # include "secp256k1.h" 5 6 # ifdef __cplusplus 7 extern "C" { 8 # endif 9 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: point: pointer to a public point 17 * scalar: a 32-byte scalar with which to multiply the point 18 */ 19 SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh( 20 const secp256k1_context* ctx, 21 unsigned char *result, 22 const secp256k1_pubkey *point, 23 const unsigned char *scalar 24 ) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4); 25 26 # ifdef __cplusplus 27 } 28 # endif 29 30 #endif