more bigint operators
This commit is contained in:
parent
f5f3bb5102
commit
72a1c45905
2 changed files with 8 additions and 0 deletions
|
|
@ -43,6 +43,7 @@ namespace fc {
|
||||||
bigint operator % ( const bigint& a )const;
|
bigint operator % ( const bigint& a )const;
|
||||||
bigint operator /= ( const bigint& a );
|
bigint operator /= ( const bigint& a );
|
||||||
bigint operator *= ( const bigint& a );
|
bigint operator *= ( const bigint& a );
|
||||||
|
bigint& operator += ( const bigint& a );
|
||||||
bigint& operator <<= ( uint32_t i );
|
bigint& operator <<= ( uint32_t i );
|
||||||
bigint operator - ( const bigint& a )const;
|
bigint operator - ( const bigint& a )const;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,13 @@ namespace fc {
|
||||||
BN_add( tmp.n, n, a.n );
|
BN_add( tmp.n, n, a.n );
|
||||||
return tmp;
|
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 {
|
bigint bigint::operator * ( const bigint& a )const {
|
||||||
BN_CTX* ctx = BN_CTX_new();
|
BN_CTX* ctx = BN_CTX_new();
|
||||||
bigint tmp(*this);
|
bigint tmp(*this);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue