aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/numbertheory/powm_fw.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-18 23:30:32 +0000
committerlloyd <[email protected]>2010-10-18 23:30:32 +0000
commitc715624c6b71327fbeb336654666899300a484cb (patch)
treec300fc3d241014faf8f449a0d5467ff5a1faf9f1 /src/math/numbertheory/powm_fw.cpp
parentde943fee887bf594583753fe0c42e44527278bb1 (diff)
BigInt::get_substring really shouldn't return size_t. Revert to
u32bit. Maybe should be word? But that would restrict window sizes more than might be desirable (we couldn't use more than 8 bit window on the assumption that the lib might be using byte limbs). Messy.
Diffstat (limited to 'src/math/numbertheory/powm_fw.cpp')
-rw-r--r--src/math/numbertheory/powm_fw.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/math/numbertheory/powm_fw.cpp b/src/math/numbertheory/powm_fw.cpp
index afc53f233..3348e55cd 100644
--- a/src/math/numbertheory/powm_fw.cpp
+++ b/src/math/numbertheory/powm_fw.cpp
@@ -45,8 +45,7 @@ BigInt Fixed_Window_Exponentiator::execute() const
for(size_t k = 0; k != window_bits; ++k)
x = reducer.square(x);
- size_t nibble = exp.get_substring(window_bits*(j-1), window_bits);
- if(nibble)
+ if(u32bit nibble = exp.get_substring(window_bits*(j-1), window_bits))
x = reducer.multiply(x, g[nibble-1]);
}
return x;