aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r--src/lib/pubkey/dl_group/dl_group.cpp9
-rw-r--r--src/lib/pubkey/dl_group/dl_group.h6
2 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/pubkey/dl_group/dl_group.cpp b/src/lib/pubkey/dl_group/dl_group.cpp
index 9bd9d2462..7a35c6362 100644
--- a/src/lib/pubkey/dl_group/dl_group.cpp
+++ b/src/lib/pubkey/dl_group/dl_group.cpp
@@ -45,7 +45,7 @@ class DL_Group_Data final
return m_mod_p.multiply(x, y);
}
- std::shared_ptr<const Montgomery_Params> monty_params() const
+ std::shared_ptr<const Montgomery_Params> monty_params_p() const
{ return m_monty_params; }
size_t p_bits() const { return m_p_bits; }
@@ -394,6 +394,11 @@ const BigInt& DL_Group::get_q() const
return data().q();
}
+std::shared_ptr<const Montgomery_Params> DL_Group::monty_params_p() const
+ {
+ return data().monty_params_p();
+ }
+
size_t DL_Group::p_bits() const
{
return data().p_bits();
@@ -427,7 +432,7 @@ BigInt DL_Group::multiply_mod_p(const BigInt& x, const BigInt& y) const
BigInt DL_Group::multi_exponentiate(const BigInt& x, const BigInt& y, const BigInt& z) const
{
- return monty_multi_exp(data().monty_params(), get_g(), x, y, z);
+ return monty_multi_exp(data().monty_params_p(), get_g(), x, y, z);
}
BigInt DL_Group::power_g_p(const BigInt& x) const
diff --git a/src/lib/pubkey/dl_group/dl_group.h b/src/lib/pubkey/dl_group/dl_group.h
index 14ef3c088..921b4060e 100644
--- a/src/lib/pubkey/dl_group/dl_group.h
+++ b/src/lib/pubkey/dl_group/dl_group.h
@@ -12,6 +12,7 @@
namespace Botan {
+class Montgomery_Params;
class DL_Group_Data;
/**
@@ -193,6 +194,11 @@ class BOTAN_PUBLIC_API(2,0) DL_Group final
BigInt multi_exponentiate(const BigInt& x, const BigInt& y, const BigInt& z) const;
/**
+ * Return parameters for Montgomery reduction/exponentiation mod p
+ */
+ std::shared_ptr<const Montgomery_Params> monty_params_p() const;
+
+ /**
* Return the size of p in bits
* Same as get_p().bits()
*/