diff --git a/include/fc/crypto/bigint.hpp b/include/fc/crypto/bigint.hpp index 2731fac..130233f 100644 --- a/include/fc/crypto/bigint.hpp +++ b/include/fc/crypto/bigint.hpp @@ -43,6 +43,7 @@ namespace fc { bigint operator % ( const bigint& a )const; bigint operator /= ( const bigint& a ); bigint operator *= ( const bigint& a ); + bigint& operator += ( const bigint& a ); bigint& operator <<= ( uint32_t i ); bigint operator - ( const bigint& a )const; diff --git a/src/crypto/bigint.cpp b/src/crypto/bigint.cpp index 20468bd..e1a7b29 100644 --- a/src/crypto/bigint.cpp +++ b/src/crypto/bigint.cpp @@ -91,6 +91,13 @@ namespace fc { BN_add( tmp.n, n, a.n ); return tmp; } + bigint& bigint::operator += ( const bigint& a ){ + bigint tmp(*this); + BN_add( tmp.n, n, a.n ); + std::swap(*this,tmp); + return *this; + } + bigint bigint::operator * ( const bigint& a )const { BN_CTX* ctx = BN_CTX_new(); bigint tmp(*this);