aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/ec_group/ec_group.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/pubkey/ec_group/ec_group.cpp')
-rw-r--r--src/lib/pubkey/ec_group/ec_group.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/pubkey/ec_group/ec_group.cpp b/src/lib/pubkey/ec_group/ec_group.cpp
index 1fb762e4b..d5a94c90c 100644
--- a/src/lib/pubkey/ec_group/ec_group.cpp
+++ b/src/lib/pubkey/ec_group/ec_group.cpp
@@ -43,7 +43,8 @@ class EC_Group_Data final
m_oid(oid),
m_p_bits(p.bits()),
m_order_bits(order.bits()),
- m_a_is_minus_3(a == p - 3)
+ m_a_is_minus_3(a == p - 3),
+ m_a_is_zero(a.is_zero())
{
}
@@ -79,6 +80,7 @@ class EC_Group_Data final
const PointGFp& base_point() const { return m_base_point; }
bool a_is_minus_3() const { return m_a_is_minus_3; }
+ bool a_is_zero() const { return m_a_is_zero; }
BigInt mod_order(const BigInt& x) const { return m_mod_order.reduce(x); }
@@ -108,6 +110,7 @@ class EC_Group_Data final
size_t m_p_bits;
size_t m_order_bits;
bool m_a_is_minus_3;
+ bool m_a_is_zero;
};
class EC_Group_Data_Map final
@@ -399,6 +402,11 @@ bool EC_Group::a_is_minus_3() const
return data().a_is_minus_3();
}
+bool EC_Group::a_is_zero() const
+ {
+ return data().a_is_zero();
+ }
+
size_t EC_Group::get_p_bits() const
{
return data().p_bits();