From fb13dfa7b3e75c81a09063250a141b6bd8c739a3 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Fri, 23 Aug 2019 16:54:31 +0200 Subject: [PATCH] Add `sign` and `verify` operations for `secp256k1` keys --- libp2p/crypto/secp256k1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libp2p/crypto/secp256k1.py b/libp2p/crypto/secp256k1.py index e2d5fb2..524877c 100644 --- a/libp2p/crypto/secp256k1.py +++ b/libp2p/crypto/secp256k1.py @@ -19,7 +19,7 @@ class Secp256k1PublicKey(PublicKey): return KeyType.Secp256k1 def verify(self, data: bytes, signature: bytes) -> bool: - raise NotImplementedError + return self.impl.verify(signature, data) class Secp256k1PrivateKey(PrivateKey): @@ -38,7 +38,7 @@ class Secp256k1PrivateKey(PrivateKey): return KeyType.Secp256k1 def sign(self, data: bytes) -> bytes: - raise NotImplementedError + return self.impl.sign(data) def get_public_key(self) -> PublicKey: public_key_impl = coincurve.PublicKey.from_secret(self.impl.secret)