aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/numbertheory/mp_numth.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-12 16:19:56 +0000
committerlloyd <[email protected]>2010-10-12 16:19:56 +0000
commit4a6fd8c70d40f88c8b51127bfa055b66b18e0f7a (patch)
treed8c5697f8de1fff74c5b813fd83c08d310fa8ac0 /src/math/numbertheory/mp_numth.cpp
parentc46a5e8d3dd8f07a92fc90027e6f7f70b989ea47 (diff)
Use size_t in all of math, remove to_u32bit
Diffstat (limited to 'src/math/numbertheory/mp_numth.cpp')
-rw-r--r--src/math/numbertheory/mp_numth.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/math/numbertheory/mp_numth.cpp b/src/math/numbertheory/mp_numth.cpp
index 4edc694e5..23623b5f0 100644
--- a/src/math/numbertheory/mp_numth.cpp
+++ b/src/math/numbertheory/mp_numth.cpp
@@ -17,9 +17,9 @@ namespace Botan {
*/
BigInt square(const BigInt& x)
{
- const u32bit x_sw = x.sig_words();
+ const size_t x_sw = x.sig_words();
- BigInt z(BigInt::Positive, round_up<u32bit>(2*x_sw, 16));
+ BigInt z(BigInt::Positive, round_up<size_t>(2*x_sw, 16));
SecureVector<word> workspace(z.size());
bigint_sqr(z.get_reg(), z.size(), workspace,
@@ -39,9 +39,9 @@ BigInt mul_add(const BigInt& a, const BigInt& b, const BigInt& c)
if(a.sign() != b.sign())
sign = BigInt::Negative;
- const u32bit a_sw = a.sig_words();
- const u32bit b_sw = b.sig_words();
- const u32bit c_sw = c.sig_words();
+ const size_t a_sw = a.sig_words();
+ const size_t b_sw = b.sig_words();
+ const size_t c_sw = c.sig_words();
BigInt r(sign, std::max(a.size() + b.size(), c_sw) + 1);
SecureVector<word> workspace(r.size());
@@ -49,7 +49,7 @@ BigInt mul_add(const BigInt& a, const BigInt& b, const BigInt& c)
bigint_mul(r.get_reg(), r.size(), workspace,
a.data(), a.size(), a_sw,
b.data(), b.size(), b_sw);
- const u32bit r_size = std::max(r.sig_words(), c_sw);
+ const size_t r_size = std::max(r.sig_words(), c_sw);
bigint_add2(r.get_reg(), r_size, c.data(), c_sw);
return r;
}