2525from sawtooth_signing .core import PublicKey
2626from sawtooth_signing .core import Context
2727
28- __CONTEXTBASE__ = secp256k1 .Base (ctx = None , flags = secp256k1 .ALL_FLAGS )
29- __CTX__ = __CONTEXTBASE__ .ctx
30-
3128
3229class Secp256k1PrivateKey (PrivateKey ):
3330 def __init__ (self , secp256k1_private_key ):
@@ -48,7 +45,7 @@ def secp256k1_private_key(self):
4845
4946 @staticmethod
5047 def from_bytes (byte_str ):
51- return Secp256k1PrivateKey (secp256k1 .PrivateKey (byte_str , ctx = __CTX__ ))
48+ return Secp256k1PrivateKey (secp256k1 .PrivateKey (byte_str ))
5249
5350 @staticmethod
5451 def from_hex (hex_str ):
@@ -60,7 +57,7 @@ def from_hex(hex_str):
6057
6158 @staticmethod
6259 def new_random ():
63- return Secp256k1PrivateKey (secp256k1 .PrivateKey (ctx = __CTX__ ))
60+ return Secp256k1PrivateKey (secp256k1 .PrivateKey ())
6461
6562
6663class Secp256k1PublicKey (PublicKey ):
@@ -84,7 +81,7 @@ def as_bytes(self):
8481
8582 @staticmethod
8683 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 )
8885 return Secp256k1PublicKey (public_key )
8986
9087 @staticmethod
@@ -97,9 +94,6 @@ def from_hex(hex_str):
9794
9895
9996class Secp256k1Context (Context ):
100- def __init__ (self ):
101- self ._ctx = __CTX__
102-
10397 def get_algorithm_name (self ):
10498 return "secp256k1"
10599
0 commit comments