From d1fdf30dcc3f26ce2572dcf451dd7987eeb980f3 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 13 Mar 2013 00:28:37 +0100 Subject: [PATCH] num_openssl.h bugfixes --- num.h | 4 ++-- num_openssl.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/num.h b/num.h index db1563b963..3bb8af360c 100644 --- a/num.h +++ b/num.h @@ -1,7 +1,7 @@ #ifndef _SECP256K1_NUM_ #define _SECP256K1_NUM_ -#include "num_gmp.h" -// #include "num_openssl.h" +// #include "num_gmp.h" +#include "num_openssl.h" #endif diff --git a/num_openssl.h b/num_openssl.h index 627a9fd5d4..67bb9ffc5f 100644 --- a/num_openssl.h +++ b/num_openssl.h @@ -71,7 +71,7 @@ public: int size = BN_num_bytes(bn); assert(size <= len); memset(bin,0,len); - BN_bn2bin(bn, bin + size - len); + BN_bn2bin(bn, bin + len - size); } void SetInt(int x) { if (x >= 0) { @@ -149,7 +149,7 @@ public: BN_rshift(high.bn, bn, bits); } - std::string ToString() { + std::string ToString() const { char *str = BN_bn2hex(bn); std::string ret(str); OPENSSL_free(str);