aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/dl_group/dl_group.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-02-25 19:06:37 -0500
committerJack Lloyd <[email protected]>2018-02-25 19:06:37 -0500
commit2f35ef0bf9d135bf42434f249df0b21b699110be (patch)
tree333264c9b7d07b2647a0a521165aee559e62b0f6 /src/lib/pubkey/dl_group/dl_group.cpp
parente7b3f2c0b8da4f5e728cf683429ab9f62ab6d1cb (diff)
parent68e5aa78138e9e2de84aab58e1cdf0e7084fda87 (diff)
Merge GH #1461 Add Montgomery_Int type
Diffstat (limited to 'src/lib/pubkey/dl_group/dl_group.cpp')
-rw-r--r--src/lib/pubkey/dl_group/dl_group.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/pubkey/dl_group/dl_group.cpp b/src/lib/pubkey/dl_group/dl_group.cpp
index a1003f508..ff8ba3727 100644
--- a/src/lib/pubkey/dl_group/dl_group.cpp
+++ b/src/lib/pubkey/dl_group/dl_group.cpp
@@ -8,6 +8,7 @@
#include <botan/dl_group.h>
#include <botan/numthry.h>
#include <botan/reducer.h>
+#include <botan/monty.h>
#include <botan/der_enc.h>
#include <botan/ber_dec.h>
#include <botan/pem.h>
@@ -22,7 +23,8 @@ class DL_Group_Data final
DL_Group_Data(const BigInt& p, const BigInt& q, const BigInt& g) :
m_p(p), m_q(q), m_g(g),
m_mod_p(p),
- m_monty(monty_precompute(m_g, m_p, m_mod_p, /*window bits=*/4)),
+ m_monty_params(std::make_shared<Montgomery_Params>(m_p, m_mod_p)),
+ m_monty(monty_precompute(m_monty_params, m_g, /*window bits=*/4)),
m_p_bits(p.bits()),
m_estimated_strength(dl_work_factor(m_p_bits))
{}
@@ -55,6 +57,7 @@ class DL_Group_Data final
BigInt m_q;
BigInt m_g;
Modular_Reducer m_mod_p;
+ std::shared_ptr<const Montgomery_Params> m_monty_params;
std::shared_ptr<const Montgomery_Exponentation_State> m_monty;
size_t m_p_bits;
size_t m_estimated_strength;