2016-03-31 15:10:43 +02:00

18 lines
446 B
Python

# Separate all crypto code so that we can easily test several implementations
import sha3
from cryptoconditions import ed25519
def hash_data(data):
"""Hash the provided data using SHA3-256"""
return sha3.sha3_256(data.encode()).hexdigest()
def generate_key_pair():
sk, pk = ed25519.ed25519_generate_key_pair()
return sk.decode(), pk.decode()
SigningKey = ed25519.Ed25519SigningKey
VerifyingKey = ed25519.Ed25519VerifyingKey