def __init__( self, private_key: UmbralPrivateKey, hash_algorithm: Type[HashAlgorithm] = DEFAULT_HASH_ALGORITHM ) -> None: self.__cryptography_private_key = private_key.to_cryptography_privkey() self.curve = private_key.params.curve self.hash_algorithm = hash_algorithm
def ecdsa_sign(message: bytes, private_key: UmbralPrivateKey) -> bytes: """ Accepts a hashed message and signs it with the private key given. :param message: Message to hash and sign :param private_key: Private key to sign with :return: signature """ signing_key = private_key.to_cryptography_privkey() signature_der_bytes = signing_key.sign(message, ec.ECDSA(SHA256)) return signature_der_bytes
def __init__(self, private_key: UmbralPrivateKey) -> None: self.__cryptography_private_key = private_key.to_cryptography_privkey() self._curve = private_key.params.curve
def __init__(self, private_key: UmbralPrivateKey): self.__cryptography_private_key = private_key.to_cryptography_privkey()