diff options
author | Jack Lloyd <[email protected]> | 2018-02-25 13:24:25 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-02-25 18:07:36 -0500 |
commit | 68e5aa78138e9e2de84aab58e1cdf0e7084fda87 (patch) | |
tree | 10b2308fd62eac2cfdd9d89af04470f7ac143324 /src/lib/pubkey/dl_group/dl_group.cpp | |
parent | 8c3ce8fba6802b821ce1307e3ca10b06d82a04ce (diff) |
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.cpp | 5 |
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; |