From cf82f74e1591c9bdb366a732fa284f8641b15dae Mon Sep 17 00:00:00 2001
From: Adrien Beraud <adrien.beraud@savoirfairelinux.com>
Date: Thu, 27 Apr 2017 04:45:35 +0200
Subject: [PATCH] python: add PrivateKey::generateEC support

---
 python/opendht.pyx     | 5 +++++
 python/opendht_cpp.pxd | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/python/opendht.pyx b/python/opendht.pyx
index 024ac9b0..d5aa9617 100644
--- a/python/opendht.pyx
+++ b/python/opendht.pyx
@@ -267,6 +267,11 @@ cdef class PrivateKey(_WithID):
         k = PrivateKey()
         k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generate())
         return k
+    @staticmethod
+    def generateEC():
+        k = PrivateKey()
+        k._key = cpp.make_shared[cpp.PrivateKey](cpp.PrivateKey.generateEC())
+        return k
 
 cdef class PublicKey(_WithID):
     cdef cpp.PublicKey _key
diff --git a/python/opendht_cpp.pxd b/python/opendht_cpp.pxd
index 9cf1330e..60c23dad 100644
--- a/python/opendht_cpp.pxd
+++ b/python/opendht_cpp.pxd
@@ -89,6 +89,8 @@ cdef extern from "opendht/crypto.h" namespace "dht::crypto":
         Blob decrypt(Blob data) const
         @staticmethod
         PrivateKey generate()
+        @staticmethod
+        PrivateKey generateEC()
 
     cdef cppclass PublicKey:
         PublicKey()
-- 
GitLab