Fixing sig up to work with cryptography ECDSA.

pull/161/head
jMyles 2018-02-13 11:08:28 -08:00
parent 261d501bd8
commit bc01f5d07a
1 changed files with 3 additions and 7 deletions

View File

@ -68,19 +68,15 @@ class CryptoPower(object):
except KeyError:
raise NoSigningPower
def sign(self, *messages):
def sign(self, message):
"""
Signs a message and returns a signature with the keccak hash.
:param Iterable messages: Messages to sign in an iterable of bytes
:rtype: bytestring
:return: Signature of message
TODO: New docstring.
"""
try:
sig_keypair = self._power_ups[SigningPower]
except KeyError as e:
raise NoSigningPower(e)
msg_digest = b"".join(API.keccak_digest(m) for m in messages)
return sig_keypair.sign(msg_digest)
return sig_keypair.sign(message)
def decrypt(self, ciphertext):
try: