Skip to content

Commit

Permalink
Merge pull request PyWaves#99 from vlzhr/master
Browse files Browse the repository at this point in the history
simple SigVerify added
  • Loading branch information
PyWaves authored Dec 2, 2019
2 parents e534914 + 3bb7cc5 commit 5a50b89
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,8 @@ def sign(privateKey, message):
return base58.b58encode(curve.calculateSignature(random64, base58.b58decode(privateKey), message))

def id(message):
return base58.b58encode(hashlib.sha256(message).digest())
return base58.b58encode(hashlib.sha256(message).digest())

def verify_signature(pub_key, message, signature):
""" all of the arguments are expected in a string format """
return curve.verifySignature(base58.b58decode(pub_key), message.encode(), base58.b58decode(signature)) == 0

0 comments on commit 5a50b89

Please sign in to comment.