From 2c3571598b3ccc75fce2a0d54a724e403a81a881 Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Thu, 15 Mar 2018 20:34:55 +0200 Subject: [PATCH] Enable ECDH + some minor fixes --- secp256k1.nim | 1 + secp256k1_wrapper/gen.sh | 10 +++++++--- secp256k1_wrapper/libsecp256k1-config.h | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) mode change 100644 => 100755 secp256k1_wrapper/gen.sh diff --git a/secp256k1.nim b/secp256k1.nim index 905cecf..39b3665 100644 --- a/secp256k1.nim +++ b/secp256k1.nim @@ -4,6 +4,7 @@ from os import DirSep const wrapperPath = currentSourcePath.rsplit(DirSep, 1)[0] & "/secp256k1_wrapper" {.passC: "-I" & wrapperPath .} {.passC: "-I" & wrapperPath & "/secp256k1".} +{.passC: "-I" & wrapperPath & "/secp256k1/src".} {.passC: "-DHAVE_CONFIG_H".} const secpSrc = wrapperPath & "/secp256k1/src/secp256k1.c" diff --git a/secp256k1_wrapper/gen.sh b/secp256k1_wrapper/gen.sh old mode 100644 new mode 100755 index fccf3da..4857169 --- a/secp256k1_wrapper/gen.sh +++ b/secp256k1_wrapper/gen.sh @@ -1,9 +1,13 @@ #!/bin/sh +set -e + THIS_DIR=$(dirname "$0") cd $THIS_DIR/secp256k1 ./autogen.sh -./configure +./configure --enable-module-ecdh --enable-module-recovery --enable-experimental make src/ecmult_static_context.h -cp src/ecmult_static_context.h "$THIS_DIR" -cp src/libsecp256k1-config.h "$THIS_DIR" + +cd - +cp secp256k1/src/ecmult_static_context.h "$THIS_DIR" +cp secp256k1/src/libsecp256k1-config.h "$THIS_DIR" diff --git a/secp256k1_wrapper/libsecp256k1-config.h b/secp256k1_wrapper/libsecp256k1-config.h index e427337..4d9167d 100644 --- a/secp256k1_wrapper/libsecp256k1-config.h +++ b/secp256k1_wrapper/libsecp256k1-config.h @@ -12,7 +12,7 @@ /* #undef COVERAGE */ /* Define this symbol to enable the ECDH module */ -/* #undef ENABLE_MODULE_ECDH */ +#define ENABLE_MODULE_ECDH 1 /* Define this symbol to enable the ECDSA pubkey recovery module */ #define ENABLE_MODULE_RECOVERY 1