aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-05 16:29:39 +0000
committerlloyd <[email protected]>2010-03-05 16:29:39 +0000
commit284cae08b24ae892ee8ce5c3511acbf0b7688a43 (patch)
treec9712105a5835261adc075677448a13703a6c436 /src
parent59b823d73c455b737d355a95c7f9a556ebb28eb0 (diff)
Remove ECDSA_PublicKey::verify
Diffstat (limited to 'src')
-rw-r--r--src/pubkey/ecdsa/ecdsa.cpp30
-rw-r--r--src/pubkey/ecdsa/ecdsa.h10
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() {}
};