diff -rN -u old-pycryptopp-ecdsa/pycryptopp/_pycryptoppmodule.cpp new-pycryptopp-ecdsa/pycryptopp/_pycryptoppmodule.cpp
--- old-pycryptopp-ecdsa/pycryptopp/_pycryptoppmodule.cpp	2011-01-06 14:21:21.000000000 -0800
+++ new-pycryptopp-ecdsa/pycryptopp/_pycryptoppmodule.cpp	2011-01-06 14:21:21.000000000 -0800
@@ -1,7 +1,7 @@
 
 #include <Python.h>
 
-//#include "publickey/ecdsamodule.hpp"
+#include "publickey/ecdsamodule.hpp"
 #include "publickey/rsamodule.hpp"
 #include "hash/sha256module.hpp"
 #include "cipher/aesmodule.hpp"
@@ -10,7 +10,7 @@
 "_pycryptopp -- Python wrappers for a few algorithms from Crypto++\n\
 \n\
 from pycryptopp import publickey\n\
-#from pycryptopp.publickey import ecdsa\n\
+from pycryptopp.publickey import ecdsa\n\
 from pycryptopp.publickey import rsa\n\
 from pycryptopp import cipher\n\
 from pycryptopp.cipher import aes\n\
@@ -21,6 +21,7 @@
     {"rsa_generate", reinterpret_cast<PyCFunction>(rsa_generate), METH_KEYWORDS, const_cast<char*>(rsa_generate__doc__)},
     {"rsa_create_verifying_key_from_string", reinterpret_cast<PyCFunction>(rsa_create_verifying_key_from_string), METH_KEYWORDS, const_cast<char*>(rsa_create_verifying_key_from_string__doc__)},
     {"rsa_create_signing_key_from_string", reinterpret_cast<PyCFunction>(rsa_create_signing_key_from_string), METH_KEYWORDS, const_cast<char*>(rsa_create_signing_key_from_string__doc__)},
+    {"ecdsa__test_kdf",  reinterpret_cast<PyCFunction>(_ecdsa_test_kdf), METH_KEYWORDS, NULL},
     {NULL, NULL, 0, NULL}  /* sentinel */
 };
 
@@ -35,7 +36,7 @@
     if (!module)
       return;
 
-    //init_ecdsa(module);
+    init_ecdsa(module);
     init_rsa(module);
     init_sha256(module);
     init_aes(module);
diff -rN -u old-pycryptopp-ecdsa/pycryptopp/publickey/ecdsamodule.cpp new-pycryptopp-ecdsa/pycryptopp/publickey/ecdsamodule.cpp
--- old-pycryptopp-ecdsa/pycryptopp/publickey/ecdsamodule.cpp	2011-01-06 14:21:21.000000000 -0800
+++ new-pycryptopp-ecdsa/pycryptopp/publickey/ecdsamodule.cpp	2011-01-06 14:21:21.000000000 -0800
@@ -266,10 +266,86 @@
 *
 */
 
+static Integer
+old_kdf(const byte *seed, int seedlen, Integer limit) {
+    // hash the seed into a private exponent (a number), looping to make sure
+    // it doesn't exceed the group order. This implements a Tiger-based KDF
+    Tiger t;
+    byte privexpbytes[24] = {0};
+    Integer privexponentm1;
+
+    t.Update(reinterpret_cast<const byte*>(TAG_AND_SALT), TAG_AND_SALT_len);
+    t.Update(reinterpret_cast<const byte*>(seed), seedlen);
+    t.TruncatedFinal(privexpbytes, Tiger::DIGESTSIZE);
+    privexponentm1.Decode(privexpbytes, sizeof(privexpbytes));
+    while (privexponentm1 >= limit) {
+        Tiger t2;
+        t2.Update(reinterpret_cast<const byte*>(TAG_AND_SALT), TAG_AND_SALT_len);
+        std::cerr << "WHEE " << sizeof(privexpbytes) << "\n";std::cerr.flush();
+        t2.Update(privexpbytes, sizeof(privexpbytes));
+        t2.TruncatedFinal(privexpbytes, Tiger::DIGESTSIZE);
+        privexponentm1.Decode(privexpbytes, sizeof(privexpbytes));
+    }
+    return privexponentm1;
+}
+
+static Integer
+kdf(const byte *seed, int seedlen, Integer limit) {
+    // hash the seed into a private exponent (a number), looping to make sure
+    // it doesn't exceed the group order. This implements HKDF with
+    // SHA2-512d-truncated-to-256 as the extractor, and SHA2-256d as the
+    // expander.
+    return Integer(5);
+
+    // david-sarah suggests:
+    //  start with a seed that is 256 bits long
+    //  compute seed % groupsize
+    //http://www.cryptopp.com/docs/ref/class_integer.html
+    //Integer(RandomNumberGenerator &rng, size_t bitcount)
+    //then operator %=
+
+}
+
+// for testing, we expose this. It hashes a seed and returns the (integer)
+// private exponent.
+PyObject *
+_ecdsa_test_kdf(PyObject* self, PyObject* args, PyObject* kwdict) {
+    static const char *kwlist[] = { "seed", "limit", NULL };
+    const byte* seed;
+    unsigned int limit_arg = 0;
+    Integer limit;
+    int seedlen;
+    if (!PyArg_ParseTupleAndKeywords(args, kwdict, "t#|I:_test_kdf__",
+                                     const_cast<char**>(kwlist),
+                                     &seed, &seedlen, &limit_arg)) {
+        return NULL;
+    }
+    if (limit_arg != 0) {
+        limit = Integer(limit_arg); // assume Integer() has an int-taking constructor
+    } else {
+        DL_GroupParameters_EC<ECP> params(ASN1::secp192r1());
+        params.SetPointCompression(true);
+        limit = params.GetGroupOrder() - 1;
+    }
+
+    Integer privexponentm1 = kdf(seed, seedlen, limit);
+
+    // now encode the exponent as a python string, and return to the caller
+    byte privexpbytes[24];
+    assert(privexponentm1.MinEncodedSize() <= 24);
+    privexponentm1.Encode(privexpbytes, sizeof(privexpbytes));
+    PyObject *result;
+    result = PyString_FromStringAndSize((const char *)privexpbytes,
+                                        sizeof(privexpbytes));
+    return result;
+}
+
+    
+
 static int
 SigningKey___init__(PyObject* self, PyObject* args, PyObject* kwdict) {
     static const char *kwlist[] = { "seed", NULL };
-    const char* seed;
+    const byte* seed;
     Py_ssize_t seedlen;
     if (!PyArg_ParseTupleAndKeywords(args, kwdict, "t#:SigningKey___init__", const_cast<char**>(kwlist), &seed, &seedlen)) {
         return -1;
@@ -289,21 +365,7 @@
     DL_GroupParameters_EC<ECP> params(ASN1::secp192r1());
     params.SetPointCompression(true);
     grouporderm1 = params.GetGroupOrder() - 1;
-    Tiger t;
-
-    t.Update(reinterpret_cast<const byte*>(TAG_AND_SALT), TAG_AND_SALT_len);
-    t.Update(reinterpret_cast<const byte*>(seed), seedlen);
-    t.TruncatedFinal(privexpbytes, Tiger::DIGESTSIZE);
-    privexponentm1.Decode(privexpbytes, sizeof(privexpbytes));
-
-    while (privexponentm1 >= grouporderm1) {
-        Tiger t2;
-        t2.Update(reinterpret_cast<const byte*>(TAG_AND_SALT), TAG_AND_SALT_len);
-        std::cerr << "WHEE " << sizeof(privexpbytes) << "\n";std::cerr.flush();
-        t2.Update(privexpbytes, sizeof(privexpbytes));
-        t2.TruncatedFinal(privexpbytes, Tiger::DIGESTSIZE);
-        privexponentm1.Decode(privexpbytes, sizeof(privexpbytes));
-    }
+    privexponentm1 = kdf(seed, seedlen, grouporderm1);
 
     SigningKey* mself = reinterpret_cast<SigningKey*>(self);
 
diff -rN -u old-pycryptopp-ecdsa/pycryptopp/publickey/ecdsamodule.hpp new-pycryptopp-ecdsa/pycryptopp/publickey/ecdsamodule.hpp
--- old-pycryptopp-ecdsa/pycryptopp/publickey/ecdsamodule.hpp	2011-01-06 14:21:21.000000000 -0800
+++ new-pycryptopp-ecdsa/pycryptopp/publickey/ecdsamodule.hpp	2011-01-06 14:21:21.000000000 -0800
@@ -1,6 +1,9 @@
 #ifndef __INCL_ECDSAMODULE_HPP
 #define __INCL_ECDSAMODULE_HPP
 
+PyObject *
+_ecdsa_test_kdf(PyObject* self, PyObject* args, PyObject* kwdict);
+
 void
 init_ecdsa(PyObject* module);
 
diff -rN -u old-pycryptopp-ecdsa/setup.py new-pycryptopp-ecdsa/setup.py
--- old-pycryptopp-ecdsa/setup.py	2011-01-06 14:21:21.000000000 -0800
+++ new-pycryptopp-ecdsa/setup.py	2011-01-06 14:21:21.000000000 -0800
@@ -24,8 +24,8 @@
 # ECDSA isn't yet supported, but it can be turned on by testing purposes.  But
 # you'll have to comment-in some lines in the C++ code to make it work.  Also
 # comment-in the unit tests.
-ECDSA=False
-# ECDSA=True
+#ECDSA=False
+ECDSA=True
 
 DEBUG=False
 if "--debug" in sys.argv:

