diff options
Diffstat (limited to 'src/math/bigint/bigint.cpp')
-rw-r--r-- | src/math/bigint/bigint.cpp | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/src/math/bigint/bigint.cpp b/src/math/bigint/bigint.cpp index e2e062f2d..df4414aba 100644 --- a/src/math/bigint/bigint.cpp +++ b/src/math/bigint/bigint.cpp @@ -40,23 +40,12 @@ BigInt::BigInt(Sign s, size_t size) } /* -* Construct a BigInt from a "raw" BigInt +* Copy constructor */ BigInt::BigInt(const BigInt& b) { - const size_t b_words = b.sig_words(); - - if(b_words) - { - reg.resize(round_up<size_t>(b_words, 8)); - reg.copy(b.data(), b_words); - set_sign(b.sign()); - } - else - { - reg.resize(2); - set_sign(Positive); - } + reg = b.get_reg(); + set_sign(b.sign()); } /* @@ -101,15 +90,6 @@ BigInt::BigInt(RandomNumberGenerator& rng, size_t bits) } /* -* Swap this BigInt with another -*/ -void BigInt::swap(BigInt& other) - { - reg.swap(other.reg); - std::swap(signedness, other.signedness); - } - -/* * Grow the internal storage */ void BigInt::grow_reg(size_t n) |