Skip to content

OpenSSL 1.1 - tests* BIGNUM - BN_init -> BN_new #7086

@vindicatorr

Description

@vindicatorr

https://wiki.openssl.org/index.php/Manual:BN_new(3)

https://www.openssl.org/docs/man1.0.2/crypto/bn.html
void BN_init(BIGNUM *);

https://www.openssl.org/docs/manmaster/crypto/bn.html
BIGNUM *BN_new(void);

  CXX      test/test_test_bitcoin-scriptnum_tests.o
In file included from test/scriptnum_tests.cpp:5:0:
test/bignum.h:26:24: error: invalid use of incomplete type ‘BIGNUM {aka struct bignum_st}’
 class CBigNum : public BIGNUM
                        ^
In file included from /usr/local/ssl/include/openssl/bn.h:132:0,
                 from test/bignum.h:16,
                 from test/scriptnum_tests.cpp:5:
/usr/local/ssl/include/openssl/ossl_typ.h:120:16: error: forward declaration of ‘BIGNUM {aka struct bignum_st}’
 typedef struct bignum_st BIGNUM;
                ^
In file included from test/scriptnum_tests.cpp:5:0:
test/bignum.h: In constructor ‘CBigNum::CBigNum()’:
test/bignum.h:31:21: error: ‘BN_init’ was not declared in this scope
         BN_init(this);
                     ^
test/bignum.h: In copy constructor ‘CBigNum::CBigNum(const CBigNum&)’:
test/bignum.h:36:21: error: ‘BN_init’ was not declared in this scope
         BN_init(this);
                     ^
test/bignum.h:37:30: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘BIGNUM* BN_copy(BIGNUM*, const BIGNUM*)’
         if (!BN_copy(this, &b))
                              ^
test/bignum.h:39:31: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘void BN_clear_free(BIGNUM*)’
             BN_clear_free(this);
                               ^
test/bignum.h: In member function ‘CBigNum& CBigNum::operator=(const CBigNum&)’:
test/bignum.h:46:30: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘BIGNUM* BN_copy(BIGNUM*, const BIGNUM*)’
         if (!BN_copy(this, &b))
                              ^
test/bignum.h: In destructor ‘CBigNum::~CBigNum()’:
test/bignum.h:53:27: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘void BN_clear_free(BIGNUM*)’
         BN_clear_free(this);
                           ^
test/bignum.h: In constructor ‘CBigNum::CBigNum(long long int)’:
test/bignum.h:56:49: error: ‘BN_init’ was not declared in this scope
     CBigNum(long long n)          { BN_init(this); setint64(n); }
                                                 ^
test/bignum.h: In constructor ‘CBigNum::CBigNum(const std::vector<unsigned char>&)’:
test/bignum.h:60:21: error: ‘BN_init’ was not declared in this scope
         BN_init(this);
                     ^
test/bignum.h: In member function ‘int CBigNum::getint() const’:
test/bignum.h:66:38: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘unsigned int BN_get_word(const BIGNUM*)’
         BN_ULONG n = BN_get_word(this);
                                      ^
test/bignum.h:67:33: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_is_negative(const BIGNUM*)’
         if (!BN_is_negative(this))
                                 ^
In file included from test/scriptnum_tests.cpp:5:0:
test/bignum.h: In member function ‘void CBigNum::setint64(int64_t)’:
test/bignum.h:115:37: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘3’ to ‘BIGNUM* BN_mpi2bn(const unsigned char*, int, BIGNUM*)’
         BN_mpi2bn(pch, p - pch, this);
                                     ^
test/bignum.h: In member function ‘void CBigNum::setvch(const std::vector<unsigned char>&)’:
test/bignum.h:130:46: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘3’ to ‘BIGNUM* BN_mpi2bn(const unsigned char*, int, BIGNUM*)’
         BN_mpi2bn(&vch2[0], vch2.size(), this);
                                              ^
test/bignum.h: In member function ‘std::vector<unsigned char> CBigNum::getvch() const’:
test/bignum.h:135:50: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_bn2mpi(const BIGNUM*, unsigned char*)’
         unsigned int nSize = BN_bn2mpi(this, NULL);
                                                  ^
test/bignum.h:139:32: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_bn2mpi(const BIGNUM*, unsigned char*)’
         BN_bn2mpi(this, &vch[0]);
                                ^
test/bignum.h: In function ‘const CBigNum operator+(const CBigNum&, const CBigNum&)’:
test/bignum.h: In member function ‘void CBigNum::setint64(int64_t)’:
test/bignum.h:115:37: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘3’ to ‘BIGNUM* BN_mpi2bn(const unsigned char*, int, BIGNUM*)’
         BN_mpi2bn(pch, p - pch, this);
                                     ^
test/bignum.h: In member function ‘void CBigNum::setvch(const std::vector<unsigned char>&)’:
test/bignum.h:130:46: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘3’ to ‘BIGNUM* BN_mpi2bn(const unsigned char*, int, BIGNUM*)’
         BN_mpi2bn(&vch2[0], vch2.size(), this);
                                              ^
test/bignum.h: In member function ‘std::vector<unsigned char> CBigNum::getvch() const’:
test/bignum.h:135:50: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_bn2mpi(const BIGNUM*, unsigned char*)’
         unsigned int nSize = BN_bn2mpi(this, NULL);
                                                  ^
test/bignum.h:139:32: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_bn2mpi(const BIGNUM*, unsigned char*)’
         BN_bn2mpi(this, &vch[0]);
                                ^
test/bignum.h: In function ‘const CBigNum operator+(const CBigNum&, const CBigNum&)’:
test/bignum.h:153:27: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_add(BIGNUM*, const BIGNUM*, const BIGNUM*)’
     if (!BN_add(&r, &a, &b))
                           ^
test/bignum.h: In function ‘const CBigNum operator-(const CBigNum&, const CBigNum&)’:
test/bignum.h:161:27: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_sub(BIGNUM*, const BIGNUM*, const BIGNUM*)’
     if (!BN_sub(&r, &a, &b))
                           ^
test/bignum.h: In function ‘const CBigNum operator-(const CBigNum&)’:
test/bignum.h:169:43: error: cannot convert ‘CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_is_negative(const BIGNUM*)’
     BN_set_negative(&r, !BN_is_negative(&r));
                                           ^
test/bignum.h: In function ‘bool operator==(const CBigNum&, const CBigNum&)’:
test/bignum.h:173:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) == 0); }
                                                                                   ^
test/bignum.h: In function ‘bool operator!=(const CBigNum&, const CBigNum&)’:
test/bignum.h:174:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) != 0); }
                                                                                   ^
test/bignum.h: In function ‘bool operator<=(const CBigNum&, const CBigNum&)’:
test/bignum.h:175:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) <= 0); }
                                                                                   ^
test/bignum.h: In function ‘bool operator>=(const CBigNum&, const CBigNum&)’:
test/bignum.h:176:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) >= 0); }
                                                                                   ^
test/bignum.h: In function ‘bool operator<(const CBigNum&, const CBigNum&)’:
test/bignum.h:177:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator<(const CBigNum& a, const CBigNum& b)  { return (BN_cmp(&a, &b) < 0); }
                                                                                   ^
test/bignum.h: In function ‘bool operator>(const CBigNum&, const CBigNum&)’:test/bignum.h:174:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) != 0); }
                                                                                   ^
test/bignum.h: In function ‘bool operator<=(const CBigNum&, const CBigNum&)’:
test/bignum.h:175:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) <= 0); }
                                                                                   ^
test/bignum.h: In function ‘bool operator>=(const CBigNum&, const CBigNum&)’:
test/bignum.h:176:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) >= 0); }
                                                                                   ^
test/bignum.h: In function ‘bool operator<(const CBigNum&, const CBigNum&)’:
test/bignum.h:177:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator<(const CBigNum& a, const CBigNum& b)  { return (BN_cmp(&a, &b) < 0); }
                                                                                   ^
test/bignum.h: In function ‘bool operator>(const CBigNum&, const CBigNum&)’:
test/bignum.h:178:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator>(const CBigNum& a, const CBigNum& b)  { return (BN_cmp(&a, &b) > 0); }
                                                                                   ^
In file included from test/scriptnum_tests.cpp:5:0:
test/bignum.h: In member function ‘int CBigNum::getint() const’:
test/bignum.h:71:5: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
In file included from test/scriptnum_tests.cpp:5:0:
test/bignum.h: In function ‘bool operator==(const CBigNum&, const CBigNum&)’:
test/bignum.h:173:92: warning: control reaches end of non-void function [-Wreturn-type]
 inline bool operator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) == 0); }
                                                                                            ^
test/bignum.h: In function ‘bool operator!=(const CBigNum&, const CBigNum&)’:
test/bignum.h:174:92: warning: control reaches end of non-void function [-Wreturn-type]
 inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) != 0); }
                                                                                            ^
test/bignum.h: In function ‘bool operator<(const CBigNum&, const CBigNum&)’:
test/bignum.h:177:91: warning: control reaches end of non-void function [-Wreturn-type]
 inline bool operator<(const CBigNum& a, const CBigNum& b)  { return (BN_cmp(&a, &b) < 0); }
                                                                                           ^
test/bignum.h: In function ‘bool operator>(const CBigNum&, const CBigNum&)’:
test/bignum.h:178:91: warning: control reaches end of non-void function [-Wreturn-type]
 inline bool operator>(const CBigNum& a, const CBigNum& b)  { return (BN_cmp(&a, &b) > 0); }
                                                                                           ^
test/bignum.h: In function ‘bool operator>=(const CBigNum&, const CBigNum&)’:
test/bignum.h:176:92: warning: control reaches end of non-void function [-Wreturn-type]
 inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) >= 0); }
                                                                                            ^
test/bignum.h: In function ‘bool operator<=(const CBigNum&, const CBigNum&)’:
test/bignum.h:175:92: warning: control reaches end of non-void function [-Wreturn-type]
 inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) <= 0); }
                                                                                            ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-self-assign"
Makefile:6494: recipe for target 'test/test_test_bitcoin-scriptnum_tests.o' failed
make[2]: *** [test/test_test_bitcoin-scriptnum_tests.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions