0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00

num_openssl.h bugfixes

This commit is contained in:
Pieter Wuille 2013-03-13 00:28:37 +01:00
parent e3f741f1d4
commit d1fdf30dcc
2 changed files with 4 additions and 4 deletions

4
num.h
View file

@ -1,7 +1,7 @@
#ifndef _SECP256K1_NUM_ #ifndef _SECP256K1_NUM_
#define _SECP256K1_NUM_ #define _SECP256K1_NUM_
#include "num_gmp.h" // #include "num_gmp.h"
// #include "num_openssl.h" #include "num_openssl.h"
#endif #endif

View file

@ -71,7 +71,7 @@ public:
int size = BN_num_bytes(bn); int size = BN_num_bytes(bn);
assert(size <= len); assert(size <= len);
memset(bin,0,len); memset(bin,0,len);
BN_bn2bin(bn, bin + size - len); BN_bn2bin(bn, bin + len - size);
} }
void SetInt(int x) { void SetInt(int x) {
if (x >= 0) { if (x >= 0) {
@ -149,7 +149,7 @@ public:
BN_rshift(high.bn, bn, bits); BN_rshift(high.bn, bn, bits);
} }
std::string ToString() { std::string ToString() const {
char *str = BN_bn2hex(bn); char *str = BN_bn2hex(bn);
std::string ret(str); std::string ret(str);
OPENSSL_free(str); OPENSSL_free(str);