Example #1
0
 def test_for_secp256k1(self, silent=False):
     try:
         from mmgen.secp256k1 import priv2pub
         assert priv2pub(('deadbeef' * 8).decode('hex'), 1)
         return True
     except:
         return False
Example #2
0
	def test_for_secp256k1(self,silent=False):
		try:
			from mmgen.secp256k1 import priv2pub
			assert priv2pub(os.urandom(32),1)
			return True
		except:
			return False
Example #3
0
	def test_for_secp256k1(self,silent=False):
		try:
			from mmgen.secp256k1 import priv2pub
			assert priv2pub(os.urandom(32),1)
			return True
		except:
			return False
Example #4
0
File: addr.py Project: mmgen/mmgen
	def test_for_secp256k1(self,silent=False):
		try:
			from mmgen.secp256k1 import priv2pub
			m = 'Unable to execute priv2pub() from secp256k1 extension module'
			assert priv2pub(bytes.fromhex('deadbeef'*8),1),m
			return True
		except:
			return False
Example #5
0
 def test_for_secp256k1(self, silent=False):
     try:
         from mmgen.secp256k1 import priv2pub
         m = 'Unable to execute priv2pub() from secp256k1 extension module'
         assert priv2pub(bytes.fromhex('deadbeef' * 8), 1), m
         return True
     except:
         return False
Example #6
0
 def to_pubhex(self, privhex):
     assert type(privhex) == PrivKey
     from mmgen.secp256k1 import priv2pub
     return PubKey(hexlify(
         priv2pub(unhexlify(privhex), int(privhex.compressed))),
                   compressed=privhex.compressed)
Example #7
0
File: addr.py Project: mmgen/mmgen
	def to_pubhex(self,privhex):
		assert type(privhex) == PrivKey
		from mmgen.secp256k1 import priv2pub
		return PubKey(priv2pub(bytes.fromhex(privhex),int(privhex.compressed)).hex(),compressed=privhex.compressed)
Example #8
0
 def to_pubhex(self, privhex):
     assert type(privhex) == PrivKey
     from mmgen.secp256k1 import priv2pub
     return PubKey(priv2pub(bytes.fromhex(privhex),
                            int(privhex.compressed)).hex(),
                   compressed=privhex.compressed)
Example #9
0
	def to_pubhex(self,privhex):
		assert type(privhex) == PrivKey
		from mmgen.secp256k1 import priv2pub
		return PubKey(hexlify(priv2pub(unhexlify(privhex),int(privhex.compressed))),compressed=privhex.compressed)