aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/numbertheory/numthry.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-06-15 20:07:39 +0000
committerlloyd <[email protected]>2012-06-15 20:07:39 +0000
commitaab06ec56681823a7f7f724211abb46633e2ef55 (patch)
tree625ea1dc130929faa951363fe2db42a017791d6c /src/math/numbertheory/numthry.cpp
parent105d9add3baa1d69a6331de8a91c7ebe904a6c0e (diff)
Index, comments, name vars in headers
Diffstat (limited to 'src/math/numbertheory/numthry.cpp')
-rw-r--r--src/math/numbertheory/numthry.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/math/numbertheory/numthry.cpp b/src/math/numbertheory/numthry.cpp
index 18f6ce429..c6816219f 100644
--- a/src/math/numbertheory/numthry.cpp
+++ b/src/math/numbertheory/numthry.cpp
@@ -253,6 +253,12 @@ BigInt inverse_mod(const BigInt& n, const BigInt& mod)
BigInt power_mod(const BigInt& base, const BigInt& exp, const BigInt& mod)
{
Power_Mod pow_mod(mod);
+
+ /*
+ * Calling set_base before set_exponent means we end up using a
+ * minimal window. This makes sense given that here we know that any
+ * precomputation is wasted.
+ */
pow_mod.set_base(base);
pow_mod.set_exponent(exp);
return pow_mod.execute();