diff --git a/mocks/trezor/.mock-generated b/mocks/trezor/.mock-generated deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mocks/trezor/__init__.py b/mocks/trezor/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mocks/trezor/config.py b/mocks/trezor/config.py deleted file mode 100644 index 717e96a16d..0000000000 --- a/mocks/trezor/config.py +++ /dev/null @@ -1,19 +0,0 @@ - -# extmod/modtrezorconfig/modtrezorconfig.c -def get(app: int, key: int) -> bytes: - ''' - Gets a value of given key for given app (or empty bytes if not set). - ''' - -# extmod/modtrezorconfig/modtrezorconfig.c -def set(app: int, key: int, value: bytes) -> None: - ''' - Sets a value of given key for given app. - Returns True on success. - ''' - -# extmod/modtrezorconfig/modtrezorconfig.c -def wipe() -> None: - ''' - Erases the whole config (use with caution!) - ''' diff --git a/mocks/trezor/crypto.py b/mocks/trezor/crypto.py deleted file mode 100644 index 58672b8b90..0000000000 --- a/mocks/trezor/crypto.py +++ /dev/null @@ -1,6 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h -def pbkdf2(prf: str, password: bytes, salt: bytes, iterations: int=None) -> Pbkdf2: - ''' - Create a PBKDF2 context - ''' diff --git a/mocks/trezor/crypto/.mock-generated b/mocks/trezor/crypto/.mock-generated deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mocks/trezor/crypto/HDNode.py b/mocks/trezor/crypto/HDNode.py deleted file mode 100644 index cf9b6e25cb..0000000000 --- a/mocks/trezor/crypto/HDNode.py +++ /dev/null @@ -1,72 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def derive(index: int) -> None: - ''' - Derive a BIP0032 child node in place. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def derive_path(path: list) -> None: - ''' - Go through a list of indexes and iteratively derive a child node in place. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def serialize_public(version: int) -> str: - ''' - Serialize the public info from HD node to base58 string. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def serialize_private(version: int) -> str: - ''' - Serialize the private info HD node to base58 string. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def clone() -> HDNode: - ''' - Returns a copy of the HD node. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def depth() -> int: - ''' - Returns a depth of the HD node. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def fingerprint() -> int: - ''' - Returns a fingerprint of the HD node (hash of the parent public key). - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def child_num() -> int: - ''' - Returns a child index of the HD node. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def chain_code() -> bytes: - ''' - Returns a chain code of the HD node. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def private_key() -> bytes: - ''' - Returns a private key of the HD node. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def public_key() -> bytes: - ''' - Returns a public key of the HD node. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def address(version: int) -> str: - ''' - Compute a base58-encoded address string from the HD node. - ''' diff --git a/mocks/trezor/crypto/aes/.mock-generated b/mocks/trezor/crypto/aes/.mock-generated deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mocks/trezor/crypto/aes/AES.py b/mocks/trezor/crypto/aes/AES.py deleted file mode 100644 index 4372f65408..0000000000 --- a/mocks/trezor/crypto/aes/AES.py +++ /dev/null @@ -1,6 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-aes.h -def update(self, data: bytes) -> bytes: - ''' - Update AES context - ''' diff --git a/mocks/trezor/crypto/aes/__init__.py b/mocks/trezor/crypto/aes/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mocks/trezor/crypto/bip32.py b/mocks/trezor/crypto/bip32.py deleted file mode 100644 index e4c401102d..0000000000 --- a/mocks/trezor/crypto/bip32.py +++ /dev/null @@ -1,12 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def deserialize(value:str, version_public: int, version_private: int) -> HDNode: - ''' - Construct a BIP0032 HD node from a base58-serialized value. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h -def from_seed(seed: bytes, curve_name: str) -> HDNode: - ''' - Construct a BIP0032 HD node from a BIP0039 seed value. - ''' diff --git a/mocks/trezor/crypto/bip39.py b/mocks/trezor/crypto/bip39.py deleted file mode 100644 index 14bca3bc93..0000000000 --- a/mocks/trezor/crypto/bip39.py +++ /dev/null @@ -1,37 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-bip39.h -def find_word(prefix: str) -> str: - ''' - Return the first word from the wordlist starting with prefix - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip39.h -def complete_word(prefix: str) -> int: - ''' - Return possible 1-letter suffixes for given word prefix - Result is a bitmask, with 'a' on the lowest bit, 'b' on the second lowest, etc. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip39.h -def generate(strength: int) -> str: - ''' - Generate a mnemonic of given strength (128, 160, 192, 224 and 256 bits) - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip39.h -def from_data(data: bytes) -> str: - ''' - Generate a mnemonic from given data (of 16, 20, 24, 28 and 32 bytes) - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip39.h -def check(mnemonic: str) -> bool: - ''' - Check whether given mnemonic is valid - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-bip39.h -def seed(mnemonic: str, passphrase: str) -> bytes: - ''' - Generate seed from mnemonic and passphrase - ''' diff --git a/mocks/trezor/crypto/curve/.mock-generated b/mocks/trezor/crypto/curve/.mock-generated deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mocks/trezor/crypto/curve/__init__.py b/mocks/trezor/crypto/curve/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mocks/trezor/crypto/curve/curve25519.py b/mocks/trezor/crypto/curve/curve25519.py deleted file mode 100644 index 344089c989..0000000000 --- a/mocks/trezor/crypto/curve/curve25519.py +++ /dev/null @@ -1,19 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-curve25519.h -def generate_secret() -> bytes: - ''' - Generate secret key. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-curve25519.h -def publickey(secret_key: bytes) -> bytes: - ''' - Computes public key from secret key. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-curve25519.h -def multiply(secret_key: bytes, public_key: bytes) -> bytes: - ''' - Multiplies point defined by public_key with scalar defined by secret_key - Useful for ECDH - ''' diff --git a/mocks/trezor/crypto/curve/ed25519.py b/mocks/trezor/crypto/curve/ed25519.py deleted file mode 100644 index 944a5e02aa..0000000000 --- a/mocks/trezor/crypto/curve/ed25519.py +++ /dev/null @@ -1,43 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h -def generate_secret() -> bytes: - ''' - Generate secret key. - ''' - -# 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. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h -def cosi_combine_publickeys(public_keys: list) -> bytes: - ''' - Combines a list of public keys used in COSI cosigning scheme - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h -def cosi_combine_signatures(R: bytes, signatures: list) -> bytes: - ''' - Combines a list of signatures used in COSI cosigning scheme - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h -def cosi_sign(secret_key: bytes, message: bytes, nonce: bytes, sigR: bytes, combined_pubkey: bytes) -> bytes: - ''' - Produce signature of message using COSI cosigning scheme - ''' diff --git a/mocks/trezor/crypto/curve/nist256p1.py b/mocks/trezor/crypto/curve/nist256p1.py deleted file mode 100644 index 41d5bfae5e..0000000000 --- a/mocks/trezor/crypto/curve/nist256p1.py +++ /dev/null @@ -1,39 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h -def generate_secret() -> bytes: - ''' - Generate secret key. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h -def publickey(secret_key: bytes, compressed: bool=True) -> bytes: - ''' - Computes public key from secret key. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h -def sign(secret_key: bytes, digest: bytes, compressed: bool=True) -> bytes: - ''' - Uses secret key to produce the signature of the digest. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h -def verify(public_key: bytes, signature: bytes, digest: bytes) -> bool: - ''' - Uses public key to verify the signature of the digest. - Returns True on success. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h -def verify_recover(signature: bytes, digest: bytes) -> bytes: - ''' - Uses signature of the digest to verify the digest and recover the public key. - Returns public key on success, None on failure. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h -def multiply(secret_key: bytes, public_key: bytes) -> bytes: - ''' - Multiplies point defined by public_key with scalar defined by secret_key - Useful for ECDH - ''' diff --git a/mocks/trezor/crypto/curve/secp256k1.py b/mocks/trezor/crypto/curve/secp256k1.py deleted file mode 100644 index 2416392fca..0000000000 --- a/mocks/trezor/crypto/curve/secp256k1.py +++ /dev/null @@ -1,39 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h -def generate_secret() -> bytes: - ''' - Generate secret key. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h -def publickey(secret_key: bytes, compressed: bool=True) -> bytes: - ''' - Computes public key from secret key. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h -def sign(secret_key: bytes, digest: bytes, compressed: bool=True) -> bytes: - ''' - Uses secret key to produce the signature of the digest. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h -def verify(public_key: bytes, signature: bytes, digest: bytes) -> bool: - ''' - Uses public key to verify the signature of the digest. - Returns True on success. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h -def verify_recover(signature: bytes, digest: bytes) -> bytes: - ''' - Uses signature of the digest to verify the digest and recover the public key. - Returns public key on success, None on failure. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h -def multiply(secret_key: bytes, public_key: bytes) -> bytes: - ''' - Multiplies point defined by public_key with scalar defined by secret_key - Useful for ECDH - ''' diff --git a/mocks/trezor/crypto/hashlib.py b/mocks/trezor/crypto/hashlib.py deleted file mode 100644 index 3c99d2e6e5..0000000000 --- a/mocks/trezor/crypto/hashlib.py +++ /dev/null @@ -1,48 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h -def blake2b(data: bytes=None, key: bytes=None) -> Blake2b: - ''' - Creates a hash context object. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h -def blake2s(data: bytes=None, key: bytes=None) -> Blake2s: - ''' - Creates a hash context object. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h -def ripemd160(data: bytes=None) -> Ripemd160: - ''' - Creates a hash context object. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-sha1.h -def sha1(data: bytes=None) -> Sha1: - ''' - Creates a hash context object. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-sha256.h -def sha256(data: bytes=None) -> Sha256: - ''' - Creates a hash context object. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h -def sha3_256(data: bytes=None) -> Sha3_256: - ''' - Creates a hash context object. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h -def sha3_512(data: bytes=None) -> Sha3_512: - ''' - Creates a hash context object. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-sha512.h -def sha512(data: bytes=None) -> Sha512: - ''' - Creates a hash context object. - ''' diff --git a/mocks/trezor/crypto/hashlib/.mock-generated b/mocks/trezor/crypto/hashlib/.mock-generated deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mocks/trezor/crypto/hashlib/__init__.py b/mocks/trezor/crypto/hashlib/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mocks/trezor/crypto/hashlib/blake2b.py b/mocks/trezor/crypto/hashlib/blake2b.py deleted file mode 100644 index bbb0314c4a..0000000000 --- a/mocks/trezor/crypto/hashlib/blake2b.py +++ /dev/null @@ -1,12 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h -def update(self, data: bytes) -> None: - ''' - Update the hash context with hashed data. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h -def digest(self) -> bytes: - ''' - Returns the digest of hashed data. - ''' diff --git a/mocks/trezor/crypto/hashlib/blake2s.py b/mocks/trezor/crypto/hashlib/blake2s.py deleted file mode 100644 index 161c92cb0b..0000000000 --- a/mocks/trezor/crypto/hashlib/blake2s.py +++ /dev/null @@ -1,12 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h -def update(self, data: bytes) -> None: - ''' - Update the hash context with hashed data. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h -def digest(self) -> bytes: - ''' - Returns the digest of hashed data. - ''' diff --git a/mocks/trezor/crypto/hashlib/ripemd160.py b/mocks/trezor/crypto/hashlib/ripemd160.py deleted file mode 100644 index b7f4ebec6d..0000000000 --- a/mocks/trezor/crypto/hashlib/ripemd160.py +++ /dev/null @@ -1,12 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h -def update(self, data: bytes) -> None: - ''' - Update the hash context with hashed data. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h -def digest(self) -> bytes: - ''' - Returns the digest of hashed data. - ''' diff --git a/mocks/trezor/crypto/hashlib/sha1.py b/mocks/trezor/crypto/hashlib/sha1.py deleted file mode 100644 index fd9b0ab143..0000000000 --- a/mocks/trezor/crypto/hashlib/sha1.py +++ /dev/null @@ -1,12 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-sha1.h -def update(self, data: bytes) -> None: - ''' - Update the hash context with hashed data. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-sha1.h -def digest(self) -> bytes: - ''' - Returns the digest of hashed data. - ''' diff --git a/mocks/trezor/crypto/hashlib/sha256.py b/mocks/trezor/crypto/hashlib/sha256.py deleted file mode 100644 index a81545fcf1..0000000000 --- a/mocks/trezor/crypto/hashlib/sha256.py +++ /dev/null @@ -1,12 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-sha256.h -def update(self, data: bytes) -> None: - ''' - Update the hash context with hashed data. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-sha256.h -def digest(self) -> bytes: - ''' - Returns the digest of hashed data. - ''' diff --git a/mocks/trezor/crypto/hashlib/sha3_256.py b/mocks/trezor/crypto/hashlib/sha3_256.py deleted file mode 100644 index f9a579c961..0000000000 --- a/mocks/trezor/crypto/hashlib/sha3_256.py +++ /dev/null @@ -1,12 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h -def update(self, data: bytes) -> None: - ''' - Update the hash context with hashed data. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h -def digest(self, keccak: bool=False) -> bytes: - ''' - Returns the digest of hashed data. - ''' diff --git a/mocks/trezor/crypto/hashlib/sha3_512.py b/mocks/trezor/crypto/hashlib/sha3_512.py deleted file mode 100644 index dcd41490eb..0000000000 --- a/mocks/trezor/crypto/hashlib/sha3_512.py +++ /dev/null @@ -1,12 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h -def update(self, data: bytes) -> None: - ''' - Update the hash context with hashed data. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h -def digest(self, keccak: bool=False) -> bytes: - ''' - Returns the digest of hashed data. - ''' diff --git a/mocks/trezor/crypto/hashlib/sha512.py b/mocks/trezor/crypto/hashlib/sha512.py deleted file mode 100644 index b54c99fc78..0000000000 --- a/mocks/trezor/crypto/hashlib/sha512.py +++ /dev/null @@ -1,12 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-sha512.h -def hash(self, data: bytes) -> None: - ''' - Update the hash context with hashed data. - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-sha512.h -def digest(self) -> bytes: - ''' - Returns the digest of hashed data. - ''' diff --git a/mocks/trezor/crypto/pbkdf2.py b/mocks/trezor/crypto/pbkdf2.py deleted file mode 100644 index 23e9b014e9..0000000000 --- a/mocks/trezor/crypto/pbkdf2.py +++ /dev/null @@ -1,12 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h -def update(self, iterations: int) -> None: - ''' - Update a PBKDF2 context - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h -def key(self) -> bytes: - ''' - Retreive derived key - ''' diff --git a/mocks/trezor/crypto/random.py b/mocks/trezor/crypto/random.py deleted file mode 100644 index 0fc9ed054c..0000000000 --- a/mocks/trezor/crypto/random.py +++ /dev/null @@ -1,18 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-random.h -def uniform(n: int) -> int: - ''' - Compute uniform random number from interval 0 ... n - 1 - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-random.h -def bytes(len: int) -> bytes: - ''' - Generate random bytes sequence of length len - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-random.h -def shuffle(data: list) -> None: - ''' - Shuffles items of given list (in-place) - ''' diff --git a/mocks/trezor/crypto/rfc6979.py b/mocks/trezor/crypto/rfc6979.py deleted file mode 100644 index baf6f8a581..0000000000 --- a/mocks/trezor/crypto/rfc6979.py +++ /dev/null @@ -1,6 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-rfc6979.h -def next() -> bytes: - ''' - Compute next 32-bytes of pseudorandom data - ''' diff --git a/mocks/trezor/crypto/ssss.py b/mocks/trezor/crypto/ssss.py deleted file mode 100644 index 79912199ec..0000000000 --- a/mocks/trezor/crypto/ssss.py +++ /dev/null @@ -1,12 +0,0 @@ - -# extmod/modtrezorcrypto/modtrezorcrypto-ssss.h -def split(m: int, n: int, secret: bytes) -> tuple: - ''' - Split secret to (M of N) shares using Shamir's Secret Sharing Scheme - ''' - -# extmod/modtrezorcrypto/modtrezorcrypto-ssss.h -def combine(shares: tuple) -> bytes: - ''' - Combine M shares of Shamir's Secret Sharing Scheme into secret - ''' diff --git a/mocks/trezor/msg.py b/mocks/trezor/msg.py deleted file mode 100644 index 3f9e38e9ed..0000000000 --- a/mocks/trezor/msg.py +++ /dev/null @@ -1,25 +0,0 @@ - -# extmod/modtrezormsg/modtrezormsg.c -def init_usb(usb_info, usb_ifaces) -> None: - ''' - Registers passed interfaces and initializes the USB stack - ''' - -# extmod/modtrezormsg/modtrezormsg.c -def deinit_usb() -> None: - ''' - Cleans up the USB stack - ''' - -# extmod/modtrezormsg/modtrezormsg.c -def send(iface: int, message: bytes) -> int: - ''' - Sends message using USB HID (device) or UDP (emulator). - ''' - -# extmod/modtrezormsg/modtrezormsg.c -def select(timeout_us: int) -> tuple: - ''' - Polls the event queue and returns the event object. - Function returns None if timeout specified in microseconds is reached. - ''' diff --git a/mocks/trezor/ui/.mock-generated b/mocks/trezor/ui/.mock-generated deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mocks/trezor/ui/__init__.py b/mocks/trezor/ui/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mocks/trezor/ui/display.py b/mocks/trezor/ui/display.py deleted file mode 100644 index bda1416e59..0000000000 --- a/mocks/trezor/ui/display.py +++ /dev/null @@ -1,116 +0,0 @@ - -# extmod/modtrezorui/modtrezorui-display.h -def clear() -> None - ''' - Clear display (with black color) - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def refresh() -> None - ''' - Refresh display (update screen) - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def bar(x: int, y: int, w: int, h: int, color: int) -> None: - ''' - Renders a bar at position (x,y = upper left corner) with width w and height h of color color. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def bar_radius(x: int, y: int, w: int, h: int, fgcolor: int, bgcolor: int=None, radius: int=None) -> None: - ''' - Renders a rounded bar at position (x,y = upper left corner) with width w and height h of color fgcolor. - Background is set to bgcolor and corners are drawn with radius radius. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def image(x: int, y: int, image: bytes) -> None: - ''' - Renders an image at position (x,y). - The image needs to be in TREZOR Optimized Image Format (TOIF) - full-color mode. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def icon(x: int, y: int, icon: bytes, fgcolor: int, bgcolor: int) -> None: - ''' - Renders an icon at position (x,y), fgcolor is used as foreground color, bgcolor as background. - The image needs to be in TREZOR Optimized Image Format (TOIF) - gray-scale mode. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def print(text: str) -> None: - ''' - Renders text using 5x8 bitmap font (using special text mode) - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def text(x: int, y: int, text: str, font: int, fgcolor: int, bgcolor: int) -> None: - ''' - Renders left-aligned text at position (x,y) where x is left position and y is baseline. - Font font is used for rendering, fgcolor is used as foreground color, bgcolor as background. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def text_center(x: int, y: int, text: str, font: int, fgcolor: int, bgcolor: int) -> None: - ''' - Renders text centered at position (x,y) where x is text center and y is baseline. - Font font is used for rendering, fgcolor is used as foreground color, bgcolor as background. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def text_right(x: int, y: int, text: str, font: int, fgcolor: int, bgcolor: int) -> None: - ''' - Renders right-aligned text at position (x,y) where x is right position and y is baseline. - Font font is used for rendering, fgcolor is used as foreground color, bgcolor as background. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def text_width(text: str, font: int) -> int: - ''' - Returns a width of text in pixels. Font font is used for rendering. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def qrcode(x: int, y: int, data: bytes, scale: int) -> None: - ''' - Renders data encoded as a QR code centered at position (x,y). - Scale determines a zoom factor. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def loader(progress: int, yoffset: int, fgcolor: int, bgcolor: int, icon: bytes=None, iconfgcolor: int=None) -> None: - ''' - Renders a rotating loader graphic. - Progress determines its position (0-1000), fgcolor is used as foreground color, bgcolor as background. - When icon and iconfgcolor are provided, an icon is drawn in the middle using the color specified in iconfgcolor. - Icon needs to be of exactly LOADER_ICON_SIZE x LOADER_ICON_SIZE pixels size. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def orientation(degrees: int=None) -> int: - ''' - Sets display orientation to 0, 90, 180 or 270 degrees. - Everything needs to be redrawn again when this function is used. - Call without the degrees parameter to just perform the read of the value. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def backlight(val: int=None) -> int: - ''' - Sets backlight intensity to the value specified in val. - Call without the val parameter to just perform the read of the value. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def offset(xy: tuple=None) -> tuple: - ''' - Sets offset (x, y) for all subsequent drawing calls. - Call without the xy parameter to just perform the read of the value. - ''' - -# extmod/modtrezorui/modtrezorui-display.h -def save(filename: string) -> None: - ''' - Saves current display contents to file filename. - ''' diff --git a/mocks/trezor/utils.py b/mocks/trezor/utils.py deleted file mode 100644 index f979751bf0..0000000000 --- a/mocks/trezor/utils.py +++ /dev/null @@ -1,15 +0,0 @@ - -# extmod/modtrezorutils/modtrezorutils.c -def memcpy(dst: bytearray, dst_ofs: int, - src: bytearray, src_ofs: int, - ''' - Copies at most `n` bytes from `src` at offset `src_ofs` to - `dst` at offset `dst_ofs`. Returns the number of actually - copied bytes. - ''' - -# extmod/modtrezorutils/modtrezorutils.c -def halt(msg: str=None) -> None: - ''' - Halts execution - '''