예제 #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
예제 #2
0
파일: addr.py 프로젝트: onedot618/mmgen
	def test_for_secp256k1(self,silent=False):
		try:
			from mmgen.secp256k1 import priv2pub
			assert priv2pub(os.urandom(32),1)
			return True
		except:
			return False
예제 #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
예제 #4
0
파일: addr.py 프로젝트: 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
예제 #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
예제 #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)
예제 #7
0
파일: addr.py 프로젝트: 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)
예제 #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)
예제 #9
0
파일: addr.py 프로젝트: onedot618/mmgen
	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)