diff options
author | lloyd <[email protected]> | 2009-11-17 05:44:33 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-11-17 05:44:33 +0000 |
commit | c12e0e4f45497f8ecb628ba7d753f87aa8db0813 (patch) | |
tree | 5f2d3c4efd7efe0ac99366a84ebd50a062e15503 /src/math | |
parent | 435965ac3b199d31b799ebefc012d928bc415621 (diff) | |
parent | 0d27bc0f8763cb6dd6307dbab7713058dee18b2c (diff) |
propagate from branch 'net.randombit.botan' (head cfb19182987fc95b2a8885584a38edb10b4709b3)
to branch 'net.randombit.botan.c++0x' (head 1570877c463fed4b632bc49a5b5ee27c57de2cb5)
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/bigint/bigint.cpp | 10 | ||||
-rw-r--r-- | src/math/bigint/divide.cpp | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/math/bigint/bigint.cpp b/src/math/bigint/bigint.cpp index 63bdc3605..7592ec439 100644 --- a/src/math/bigint/bigint.cpp +++ b/src/math/bigint/bigint.cpp @@ -25,7 +25,7 @@ BigInt::BigInt(u64bit n) const u32bit limbs_needed = sizeof(u64bit) / sizeof(word); - reg.create(4*limbs_needed); + reg.resize(4*limbs_needed); for(u32bit j = 0; j != limbs_needed; ++j) reg[j] = ((n >> (j*MP_WORD_BITS)) & MP_WORD_MASK); } @@ -35,7 +35,7 @@ BigInt::BigInt(u64bit n) */ BigInt::BigInt(Sign s, u32bit size) { - reg.create(round_up(size, 8)); + reg.resize(round_up(size, 8)); signedness = s; } @@ -48,13 +48,13 @@ BigInt::BigInt(const BigInt& b) if(b_words) { - reg.create(round_up(b_words, 8)); + reg.resize(round_up(b_words, 8)); reg.copy(b.data(), b_words); set_sign(b.sign()); } else { - reg.create(2); + reg.resize(2); set_sign(Positive); } } @@ -346,7 +346,7 @@ void BigInt::binary_decode(const byte buf[], u32bit length) { const u32bit WORD_BYTES = sizeof(word); - reg.create(round_up((length / WORD_BYTES) + 1, 8)); + reg.resize(round_up((length / WORD_BYTES) + 1, 8)); for(u32bit j = 0; j != length / WORD_BYTES; ++j) { diff --git a/src/math/bigint/divide.cpp b/src/math/bigint/divide.cpp index 6afaa0fee..45d31350d 100644 --- a/src/math/bigint/divide.cpp +++ b/src/math/bigint/divide.cpp @@ -62,7 +62,7 @@ void divide(const BigInt& x, const BigInt& y_arg, BigInt& q, BigInt& r) const u32bit n = r.sig_words() - 1, t = y_words - 1; - q.get_reg().create(n - t + 1); + q.get_reg().resize(n - t + 1); if(n <= t) { while(r > y) { r -= y; ++q; } |