aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/numbertheory/powm_mnt.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/powm_mnt.cpp
parentc46a5e8d3dd8f07a92fc90027e6f7f70b989ea47 (diff)
Use size_t in all of math, remove to_u32bit
Diffstat (limited to 'src/math/numbertheory/powm_mnt.cpp')
-rw-r--r--src/math/numbertheory/powm_mnt.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/math/numbertheory/powm_mnt.cpp b/src/math/numbertheory/powm_mnt.cpp
index 8b915390c..038ce14da 100644
--- a/src/math/numbertheory/powm_mnt.cpp
+++ b/src/math/numbertheory/powm_mnt.cpp
@@ -44,12 +44,12 @@ void Montgomery_Exponentiator::set_base(const BigInt& base)
g[0].get_reg().set(&z[0], mod_words + 1);
const BigInt& x = g[0];
- const u32bit x_sig = x.sig_words();
+ const size_t x_sig = x.sig_words();
- for(u32bit i = 1; i != g.size(); ++i)
+ for(size_t i = 1; i != g.size(); ++i)
{
const BigInt& y = g[i-1];
- const u32bit y_sig = y.sig_words();
+ const size_t y_sig = y.sig_words();
zeroise(z);
bigint_mul(&z[0], z.size(), &workspace[0],
@@ -69,15 +69,15 @@ void Montgomery_Exponentiator::set_base(const BigInt& base)
*/
BigInt Montgomery_Exponentiator::execute() const
{
- const u32bit exp_nibbles = (exp_bits + window_bits - 1) / window_bits;
+ const size_t exp_nibbles = (exp_bits + window_bits - 1) / window_bits;
BigInt x = R_mod;
SecureVector<word> z(2 * (mod_words + 1));
SecureVector<word> workspace(2 * (mod_words + 1));
- for(u32bit i = exp_nibbles; i > 0; --i)
+ for(size_t i = exp_nibbles; i > 0; --i)
{
- for(u32bit k = 0; k != window_bits; ++k)
+ for(size_t k = 0; k != window_bits; ++k)
{
zeroise(z);
bigint_sqr(&z[0], z.size(), &workspace[0],
@@ -90,7 +90,7 @@ BigInt Montgomery_Exponentiator::execute() const
x.get_reg().set(&z[0], mod_words + 1);
}
- u32bit nibble = exp.get_substring(window_bits*(i-1), window_bits);
+ size_t nibble = exp.get_substring(window_bits*(i-1), window_bits);
if(nibble)
{
const BigInt& y = g[nibble-1];