From 3a39aa0892b01ceb72f95c52844133458a429c11 Mon Sep 17 00:00:00 2001 From: cheatfate Date: Wed, 21 Mar 2018 11:42:07 +0200 Subject: [PATCH] Add wrapper for secp256k1_ecdh_raw() --- secp256k1.nim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/secp256k1.nim b/secp256k1.nim index 96e7297..ad1a98d 100644 --- a/secp256k1.nim +++ b/secp256k1.nim @@ -272,3 +272,19 @@ proc secp256k1_ecdh*(ctx: ptr secp256k1_context; output32: ptr cuchar; ## In: pubkey: a pointer to a secp256k1_pubkey containing an ## initialized public key ## privkey: a 32-byte scalar with which to multiply the point + ## + +proc secp256k1_ecdh_raw*(ctx: ptr secp256k1_context; output32: ptr cuchar; + pubkey: ptr secp256k1_pubkey; + input32: ptr cuchar): cint {.secp.} + ## Compute an EC Diffie-Hellman secret in constant time + ## Returns: 1: exponentiation was successful + ## 0: scalar was invalid (zero or overflow) + ## Args: ctx: pointer to a context object (cannot be NULL) + ## Out: result: a 33-byte array which will be populated by an ECDH + ## secret computed from the point and scalar in form + ## of compressed point + ## In: pubkey: a pointer to a secp256k1_pubkey containing an + ## initialized public key + ## privkey: a 32-byte scalar with which to multiply the point + ##