aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/nr
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-05 06:47:02 +0000
committerlloyd <[email protected]>2010-03-05 06:47:02 +0000
commit1b68d7e53c4bc5e6b2938194b0f7eda78a72ce43 (patch)
treeda1b0482d875a48fe95e133346aee4baabcbf7cb /src/pubkey/nr
parentd4ef447dc8b3b4f40f2ab250b1c364e2f74ccfa4 (diff)
Remove the sign() operation from the public key objects, totally replaced
by using the ops. Add real ECDSA test vectors (two found in ANSI X9.62)
Diffstat (limited to 'src/pubkey/nr')
-rw-r--r--src/pubkey/nr/nr.cpp18
-rw-r--r--src/pubkey/nr/nr.h5
2 files changed, 2 insertions, 21 deletions
diff --git a/src/pubkey/nr/nr.cpp b/src/pubkey/nr/nr.cpp
index 08ed6b376..df483499b 100644
--- a/src/pubkey/nr/nr.cpp
+++ b/src/pubkey/nr/nr.cpp
@@ -74,22 +74,6 @@ NR_PrivateKey::NR_PrivateKey(const AlgorithmIdentifier& alg_id,
}
/*
-* Nyberg-Rueppel Signature Operation
-*/
-SecureVector<byte> NR_PrivateKey::sign(const byte in[], u32bit length,
- RandomNumberGenerator& rng) const
- {
- const BigInt& q = group_q();
-
- BigInt k;
- do
- k.randomize(rng, q.bits());
- while(k >= q);
-
- return core.sign(in, length, k);
- }
-
-/*
* Check Private Nyberg-Rueppel Parameters
*/
bool NR_PrivateKey::check_key(RandomNumberGenerator& rng, bool strong) const
@@ -141,7 +125,7 @@ SecureVector<byte> NR_Signature_Operation::sign(const byte msg[],
BigInt c = mod_q.reduce(powermod_g_p(k) + f);
if(c.is_zero())
- throw Internal_Error("Default_NR_Op::sign: c was zero");
+ throw Internal_Error("NR_Signature_Operation: c was zero");
BigInt d = mod_q.reduce(k - x * c);
SecureVector<byte> output(2*q.bytes());
diff --git a/src/pubkey/nr/nr.h b/src/pubkey/nr/nr.h
index 013f3d42b..5fc7b2914 100644
--- a/src/pubkey/nr/nr.h
+++ b/src/pubkey/nr/nr.h
@@ -1,6 +1,6 @@
/*
* Nyberg-Rueppel
-* (C) 1999-2007 Jack Lloyd
+* (C) 1999-2010 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
@@ -48,9 +48,6 @@ class BOTAN_DLL NR_PrivateKey : public NR_PublicKey,
public virtual DL_Scheme_PrivateKey
{
public:
- SecureVector<byte> sign(const byte msg[], u32bit msg_len,
- RandomNumberGenerator& rng) const;
-
bool check_key(RandomNumberGenerator& rng, bool strong) const;
NR_PrivateKey(const AlgorithmIdentifier& alg_id,