mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-06-30 20:02:34 +00:00
41 lines
980 B
Python
41 lines
980 B
Python
from typing import *
|
|
def generate_secret() -> bytes:
|
|
"""
|
|
Generate secret key.
|
|
"""
|
|
def publickey(secret_key: bytes) -> bytes:
|
|
"""
|
|
Computes public key from secret key.
|
|
"""
|
|
def sign(
|
|
secret_key: bytes,
|
|
digest: bytes,
|
|
) -> bytes:
|
|
"""
|
|
Uses secret key to produce the signature of the digest.
|
|
"""
|
|
def verify_publickey(public_key: bytes) -> bool:
|
|
"""
|
|
Verifies whether the public key is valid.
|
|
Returns True on success.
|
|
"""
|
|
def verify(public_key: bytes, signature: bytes, digest: bytes) -> bool:
|
|
"""
|
|
Uses public key to verify the signature of the digest.
|
|
Returns True on success.
|
|
"""
|
|
def tweak_public_key(
|
|
public_key: bytes,
|
|
root_hash: bytes | None = None,
|
|
) -> bytes:
|
|
"""
|
|
Tweaks the public key with the specified root_hash.
|
|
"""
|
|
def tweak_secret_key(
|
|
secret_key: bytes,
|
|
root_hash: bytes | None = None,
|
|
) -> bytes:
|
|
"""
|
|
Tweaks the secret key with the specified root_hash.
|
|
"""
|