25
25
from sawtooth_signing .core import PublicKey
26
26
from sawtooth_signing .core import Context
27
27
28
- __CONTEXTBASE__ = secp256k1 .Base (ctx = None , flags = secp256k1 .ALL_FLAGS )
29
- __CTX__ = __CONTEXTBASE__ .ctx
30
-
31
28
32
29
class Secp256k1PrivateKey (PrivateKey ):
33
30
def __init__ (self , secp256k1_private_key ):
@@ -48,7 +45,7 @@ def secp256k1_private_key(self):
48
45
49
46
@staticmethod
50
47
def from_bytes (byte_str ):
51
- return Secp256k1PrivateKey (secp256k1 .PrivateKey (byte_str , ctx = __CTX__ ))
48
+ return Secp256k1PrivateKey (secp256k1 .PrivateKey (byte_str ))
52
49
53
50
@staticmethod
54
51
def from_hex (hex_str ):
@@ -60,7 +57,7 @@ def from_hex(hex_str):
60
57
61
58
@staticmethod
62
59
def new_random ():
63
- return Secp256k1PrivateKey (secp256k1 .PrivateKey (ctx = __CTX__ ))
60
+ return Secp256k1PrivateKey (secp256k1 .PrivateKey ())
64
61
65
62
66
63
class Secp256k1PublicKey (PublicKey ):
@@ -84,7 +81,7 @@ def as_bytes(self):
84
81
85
82
@staticmethod
86
83
def from_bytes (byte_str ):
87
- public_key = secp256k1 .PublicKey (byte_str , raw = True , ctx = __CTX__ )
84
+ public_key = secp256k1 .PublicKey (byte_str , raw = True )
88
85
return Secp256k1PublicKey (public_key )
89
86
90
87
@staticmethod
@@ -97,9 +94,6 @@ def from_hex(hex_str):
97
94
98
95
99
96
class Secp256k1Context (Context ):
100
- def __init__ (self ):
101
- self ._ctx = __CTX__
102
-
103
97
def get_algorithm_name (self ):
104
98
return "secp256k1"
105
99
0 commit comments