diff options
Diffstat (limited to 'src/lib/pubkey/ecgdsa/ecgdsa.cpp')
-rw-r--r-- | src/lib/pubkey/ecgdsa/ecgdsa.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/pubkey/ecgdsa/ecgdsa.cpp b/src/lib/pubkey/ecgdsa/ecgdsa.cpp index 062bb524d..192d999a8 100644 --- a/src/lib/pubkey/ecgdsa/ecgdsa.cpp +++ b/src/lib/pubkey/ecgdsa/ecgdsa.cpp @@ -10,6 +10,7 @@ #include <botan/keypair.h> #include <botan/reducer.h> #include <botan/internal/pk_ops_impl.h> +#include <botan/internal/point_mul.h> namespace Botan { @@ -86,7 +87,7 @@ class ECGDSA_Verification_Operation final : public PK_Ops::Verification_with_EMS const std::string& emsa) : PK_Ops::Verification_with_EMSA(emsa), m_group(ecgdsa.domain()), - m_public_point(ecgdsa.public_point()) + m_gy_mul(m_group.get_base_point(), ecgdsa.public_point()) { } @@ -98,7 +99,7 @@ class ECGDSA_Verification_Operation final : public PK_Ops::Verification_with_EMS const uint8_t sig[], size_t sig_len) override; private: const EC_Group m_group; - const PointGFp& m_public_point; + const PointGFp_Multi_Point_Precompute m_gy_mul; }; bool ECGDSA_Verification_Operation::verify(const uint8_t msg[], size_t msg_len, @@ -119,7 +120,7 @@ bool ECGDSA_Verification_Operation::verify(const uint8_t msg[], size_t msg_len, const BigInt u1 = m_group.multiply_mod_order(e, w); const BigInt u2 = m_group.multiply_mod_order(s, w); - const PointGFp R = m_group.point_multiply(u1, m_public_point, u2); + const PointGFp R = m_gy_mul.multi_exp(u1, u2); if(R.is_zero()) return false; |