Skip to content

Commit a7253b9

Browse files
committed
remove secp256k1 python library
Signed-off-by: Mic Bowman <mic.bowman@intel.com>
1 parent a1f0601 commit a7253b9

File tree

2 files changed

+0
-48
lines changed

2 files changed

+0
-48
lines changed

build/python_requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ loguru>=0.6.0
66
mergedeep>=1.3.4
77
requests>=2.28.2
88
requests-toolbelt>=0.10.1
9-
secp256k1==0.13.2
109
toml>=0.10.2
1110
PyYAML>=6.0
1211
Twisted>=22.10.0

python/pdo/common/keys.py

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
logger = logging.getLogger(__name__)
2323

2424
import binascii
25-
import secp256k1
26-
2725

2826
# -----------------------------------------------------------------
2927
# -----------------------------------------------------------------
@@ -49,51 +47,6 @@ def read_transaction_keys_from_file(key_file, search_path, \
4947

5048
return txn_keys
5149

52-
# -----------------------------------------------------------------
53-
# -----------------------------------------------------------------
54-
class TransactionKeys(object) :
55-
"""
56-
Wrapper for managing Sawtooth transaction keys
57-
"""
58-
59-
@classmethod
60-
def read_from_file(cls, file_name, search_path = ['.', './keys']) :
61-
full_file = putils.find_file_in_path(file_name, search_path)
62-
with open(full_file, "r") as ff :
63-
hex_encoded_private_key = ff.read()
64-
65-
priv = binascii.unhexlify(hex_encoded_private_key)
66-
return cls(secp256k1.PrivateKey(priv))
67-
68-
@classmethod
69-
def from_hex(cls, hex_encoded_private_key) :
70-
priv = binascii.unhexlify(hex_encoded_private_key)
71-
return cls(secp256k1.PrivateKey(priv))
72-
73-
def __init__(self, private_key = None) :
74-
if private_key == None :
75-
private_key = secp256k1.PrivateKey()
76-
77-
self.public_key = private_key.pubkey
78-
self.private_key = private_key
79-
80-
@property
81-
def hashed_identity(self) :
82-
key_byte_array = crypto.string_to_byte_array(self.txn_public)
83-
hashed_txn_key = crypto.compute_message_hash(key_byte_array)
84-
encoded_hashed_key = crypto.byte_array_to_hex(hashed_txn_key)
85-
encoded_hashed_key = encoded_hashed_key.lower()
86-
return encoded_hashed_key
87-
88-
@property
89-
def txn_private(self) :
90-
return self.private_key.serialize()
91-
92-
@property
93-
def txn_public(self) :
94-
return self.public_key.serialize().hex()
95-
96-
9750
# -----------------------------------------------------------------
9851
# -----------------------------------------------------------------
9952
class EnclaveKeys(object) :

0 commit comments

Comments
 (0)