aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/numbertheory/monty.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-08-17 05:26:54 -0400
committerJack Lloyd <[email protected]>2019-08-17 05:26:54 -0400
commit56c84ce1db8be25a3c739968ff36375b8dde633d (patch)
treed9cab1b1a095a3ce43ab96f6dc84fbaf4b10a9e2 /src/lib/math/numbertheory/monty.cpp
parent7ca073323cb6bddea6f71658879962457efb62b8 (diff)
Avoid using old pow_mod interface in RSA
On its own gives a modest speedup (3-5%) to RSA sign/decrypt, and it is needed for another more complicated optimization.
Diffstat (limited to 'src/lib/math/numbertheory/monty.cpp')
-rw-r--r--src/lib/math/numbertheory/monty.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/math/numbertheory/monty.cpp b/src/lib/math/numbertheory/monty.cpp
index f2a31d8e1..b05bdd30b 100644
--- a/src/lib/math/numbertheory/monty.cpp
+++ b/src/lib/math/numbertheory/monty.cpp
@@ -39,6 +39,7 @@ Montgomery_Params::Montgomery_Params(const BigInt& p)
const BigInt r = BigInt::power_of_2(m_p_words * BOTAN_MP_WORD_BITS);
+ // It might be faster to use ct_modulo here vs setting up Barrett reduction?
Modular_Reducer mod_p(p);
m_r1 = mod_p.reduce(r);