aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/gost_3410/gost_3410.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-05 16:33:54 +0000
committerlloyd <[email protected]>2010-03-05 16:33:54 +0000
commitce88e2c6918bb012321e1d7599c2a13b9ba9301e (patch)
treea87a57844f494a9b9ea6022b655f28a0c031a6ab /src/pubkey/gost_3410/gost_3410.cpp
parent284cae08b24ae892ee8ce5c3511acbf0b7688a43 (diff)
Remove sign and verify ops from key types
Diffstat (limited to 'src/pubkey/gost_3410/gost_3410.cpp')
-rw-r--r--src/pubkey/gost_3410/gost_3410.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/pubkey/gost_3410/gost_3410.cpp b/src/pubkey/gost_3410/gost_3410.cpp
index 1c028eca3..9a7681cb2 100644
--- a/src/pubkey/gost_3410/gost_3410.cpp
+++ b/src/pubkey/gost_3410/gost_3410.cpp
@@ -68,39 +68,6 @@ GOST_3410_PublicKey::GOST_3410_PublicKey(const AlgorithmIdentifier& alg_id,
}
}
-bool GOST_3410_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("domain parameters not set");
-
- 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;
-
- e %= n;
- if(e == 0)
- e = 1;
-
- BigInt v = inverse_mod(e, n);
-
- BigInt z1 = (s*v) % n;
- BigInt z2 = (-r*v) % n;
-
- PointGFp R = (z1 * domain().get_base_point() + z2 * public_point());
-
- return (R.get_affine_x() == r);
- }
-
GOST_3410_Signature_Operation::GOST_3410_Signature_Operation(
const GOST_3410_PrivateKey& gost_3410) :