diff options
-rw-r--r-- | src/pubkey/ecdsa/ecdsa.cpp | 30 | ||||
-rw-r--r-- | src/pubkey/ecdsa/ecdsa.h | 10 |
2 files changed, 0 insertions, 40 deletions
diff --git a/src/pubkey/ecdsa/ecdsa.cpp b/src/pubkey/ecdsa/ecdsa.cpp index 143389751..fc2a75454 100644 --- a/src/pubkey/ecdsa/ecdsa.cpp +++ b/src/pubkey/ecdsa/ecdsa.cpp @@ -9,38 +9,8 @@ #include <botan/ecdsa.h> -#include <iostream> - namespace Botan { -bool ECDSA_PublicKey::verify(const byte msg[], u32bit msg_len, - const byte sig[], u32bit sig_len) const - { - const BigInt& n = domain().get_order(); - - if(n == 0) - throw Invalid_State("ECDSA_PublicKey::verify: Not initialized"); - - if(sig_len != n.bytes()*2) - return false; - - BigInt e(msg, msg_len); - - BigInt r(sig, sig_len / 2); - BigInt s(sig + sig_len / 2, sig_len / 2); - - if(r < 0 || r >= n || s < 0 || s >= n) - return false; - - BigInt w = inverse_mod(s, n); - - PointGFp R = w * (e * domain().get_base_point() + r*public_point()); - if(R.is_zero()) - return false; - - return (R.get_affine_x() % n == r); - } - ECDSA_Signature_Operation::ECDSA_Signature_Operation(const ECDSA_PrivateKey& ecdsa) : base_point(ecdsa.domain().get_base_point()), order(ecdsa.domain().get_order()), diff --git a/src/pubkey/ecdsa/ecdsa.h b/src/pubkey/ecdsa/ecdsa.h index c26e47354..240c981e8 100644 --- a/src/pubkey/ecdsa/ecdsa.h +++ b/src/pubkey/ecdsa/ecdsa.h @@ -54,16 +54,6 @@ class BOTAN_DLL ECDSA_PublicKey : public virtual EC_PublicKey, u32bit message_part_size() const { return domain().get_order().bytes(); } - /** - * Verify a message with this key. - * @param message the byte array containing the message - * @param mess_len the number of bytes in the message byte array - * @param signature the byte array containing the signature - * @param sig_len the number of bytes in the signature byte array - */ - bool verify(const byte message[], u32bit mess_len, - const byte signature[], u32bit sig_len) const; - protected: ECDSA_PublicKey() {} }; |