lbry-sdk/lbrynet/core/cryptoutils.py

19 lines
431 B
Python
Raw Normal View History

2015-08-20 17:27:15 +02:00
import seccure
2017-07-24 09:04:49 +02:00
import hashlib
2015-08-20 17:27:15 +02:00
def get_lbry_hash_obj():
2017-07-24 09:04:49 +02:00
return hashlib.sha384()
2015-08-20 17:27:15 +02:00
def get_pub_key(pass_phrase):
return str(seccure.passphrase_to_pubkey(pass_phrase, curve="brainpoolp384r1"))
def sign_with_pass_phrase(m, pass_phrase):
return seccure.sign(m, pass_phrase, curve="brainpoolp384r1")
def verify_signature(m, signature, pub_key):
return seccure.verify(m, signature, pub_key, curve="brainpoolp384r1")