1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-10-12 19:09:10 +00:00
trezor-firmware/core/mocks/generated/trezorutils.pyi

43 lines
1021 B
Python
Raw Normal View History

2017-06-14 17:27:02 +00:00
from typing import *
2017-06-14 15:41:45 +00:00
# extmod/modtrezorutils/modtrezorutils.c
def consteq(sec: bytes, pub: bytes) -> bool:
"""
Compares the private information in `sec` with public, user-provided
information in `pub`. Runs in constant time, corresponding to a length
of `pub`. Can access memory behind valid length of `sec`, caller is
expected to avoid any invalid memory access.
"""
2017-06-14 15:41:45 +00:00
# extmod/modtrezorutils/modtrezorutils.c
def memcpy(
2019-06-09 09:24:06 +00:00
dst: bytearray, dst_ofs: int, src: bytes, src_ofs: int, n: int
) -> int:
"""
2017-06-14 15:41:45 +00:00
Copies at most `n` bytes from `src` at offset `src_ofs` to
`dst` at offset `dst_ofs`. Returns the number of actually
copied bytes.
"""
2017-06-14 15:41:45 +00:00
# extmod/modtrezorutils/modtrezorutils.c
def halt(msg: str = None) -> None:
"""
2017-06-14 15:41:45 +00:00
Halts execution.
"""
2018-03-09 10:37:06 +00:00
# extmod/modtrezorutils/modtrezorutils.c
def set_mode_unprivileged() -> None:
"""
2018-03-09 10:37:06 +00:00
Set unprivileged mode.
"""
2019-06-09 09:24:06 +00:00
GITREV: str
VERSION_MAJOR: int
VERSION_MINOR: int
VERSION_PATCH: int
MODEL: str
EMULATOR: bool