1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-10-16 04:49:08 +00:00
trezor-firmware/mocks/trezor/crypto/curve/ed25519.py
2016-09-27 17:26:17 +02:00

20 lines
570 B
Python

# ../extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
def publickey(secret_key: bytes) -> bytes:
'''
Computes public key from secret key.
'''
# ../extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
def sign(secret_key: bytes, message: bytes) -> bytes:
'''
Uses secret key to produce the signature of message.
'''
# ../extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
def verify(public_key: bytes, signature: bytes, message: bytes) -> bool:
'''
Uses public key to verify the signature of the message.
Returns True on success.
'''