diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-aes.h b/extmod/modtrezorcrypto/modtrezorcrypto-aes.h index 4369883cf1..4814972ec4 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-aes.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-aes.h @@ -23,7 +23,10 @@ typedef struct _mp_obj_AES_t { uint8_t ctr[AES_BLOCK_SIZE]; } mp_obj_AES_t; -/// def trezor.crypto.aes.AES(mode:int, key: bytes, iv: bytes=None) -> AES +/// def trezor.crypto.aes.AES(mode:int, key: bytes, iv: bytes=None) -> AES: +/// ''' +/// Create AES context +/// ''' STATIC mp_obj_t mod_TrezorCrypto_AES_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 2, 3, false); mp_obj_AES_t *o = m_new_obj(mp_obj_AES_t); @@ -74,7 +77,10 @@ STATIC mp_obj_t mod_TrezorCrypto_AES_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(o); } -/// def AES.crypt(self, data: bytes) -> bytes +/// def trezor.crypto.aes.AES.update(self, data: bytes) -> bytes: +/// ''' +/// Update AES context +/// ''' STATIC mp_obj_t mod_TrezorCrypto_AES_update(mp_obj_t self, mp_obj_t data) { mp_buffer_info_t buf; mp_get_buffer_raise(data, &buf, MP_BUFFER_READ); diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h b/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h index f98f78f469..8c6e659a80 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h @@ -20,7 +20,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Bip39_make_new(const mp_obj_type_t *type, size_ return MP_OBJ_FROM_PTR(o); } -/// def trezor.crypto.bip39.generate(strength: int) -> str +/// def trezor.crypto.bip39.generate(strength: int) -> str: /// ''' /// Generate a mnemonic of given strength (128, 160, 192, 224 and 256 bits) /// ''' @@ -37,7 +37,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Bip39_generate(mp_obj_t self, mp_obj_t strength } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorCrypto_Bip39_generate_obj, mod_TrezorCrypto_Bip39_generate); -/// def trezor.crypto.bip39.from_data(data: bytes) -> str +/// def trezor.crypto.bip39.from_data(data: bytes) -> str: /// ''' /// Generate a mnemonic from given data (of 16, 20, 24, 28 and 32 bytes) /// ''' @@ -55,7 +55,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Bip39_from_data(mp_obj_t self, mp_obj_t data) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorCrypto_Bip39_from_data_obj, mod_TrezorCrypto_Bip39_from_data); -/// def trezor.crypto.bip39.check(mnemonic: str) -> bool +/// def trezor.crypto.bip39.check(mnemonic: str) -> bool: /// ''' /// Check whether given mnemonic is valid /// ''' @@ -66,7 +66,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Bip39_check(mp_obj_t self, mp_obj_t mnemonic) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorCrypto_Bip39_check_obj, mod_TrezorCrypto_Bip39_check); -/// def trezor.crypto.bip39.seed(mnemonic: str, passphrase: str) -> bytes +/// def trezor.crypto.bip39.seed(mnemonic: str, passphrase: str) -> bytes: /// ''' /// Generate seed from mnemonic and passphrase /// ''' diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h b/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h index fb9e9475b9..0a9ae59a89 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h @@ -20,7 +20,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Ed25519_make_new(const mp_obj_type_t *type, siz return MP_OBJ_FROM_PTR(o); } -/// def trezor.crypto.curve.ed25519.publickey(secret_key: bytes) -> bytes +/// def trezor.crypto.curve.ed25519.publickey(secret_key: bytes) -> bytes: /// ''' /// Computes public key from secret key. /// ''' @@ -37,7 +37,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Ed25519_publickey(mp_obj_t self, mp_obj_t secre } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorCrypto_Ed25519_publickey_obj, mod_TrezorCrypto_Ed25519_publickey); -/// def trezor.crypto.curve.ed25519.sign(secret_key: bytes, message: bytes) -> bytes +/// def trezor.crypto.curve.ed25519.sign(secret_key: bytes, message: bytes) -> bytes: /// ''' /// Uses secret key to produce the signature of message. /// ''' @@ -57,7 +57,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Ed25519_sign(mp_obj_t self, mp_obj_t secret_key } STATIC MP_DEFINE_CONST_FUN_OBJ_3(mod_TrezorCrypto_Ed25519_sign_obj, mod_TrezorCrypto_Ed25519_sign); -/// def trezor.crypto.curve.ed25519.verify(public_key: bytes, signature: bytes, message: bytes) -> bool +/// def trezor.crypto.curve.ed25519.verify(public_key: bytes, signature: bytes, message: bytes) -> bool: /// ''' /// Uses public key to verify the signature of the message. /// Returns True on success. diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h b/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h index cec1c81980..78467b112e 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h @@ -21,7 +21,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Nist256p1_make_new(const mp_obj_type_t *type, s return MP_OBJ_FROM_PTR(o); } -/// def trezor.crypto.curve.nist256p1.publickey(secret_key: bytes, compressed: bool=True) -> bytes +/// def trezor.crypto.curve.nist256p1.publickey(secret_key: bytes, compressed: bool=True) -> bytes: /// ''' /// Computes public key from secret key. /// ''' @@ -44,7 +44,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Nist256p1_publickey(size_t n_args, const mp_obj } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorCrypto_Nist256p1_publickey_obj, 2, 3, mod_TrezorCrypto_Nist256p1_publickey); -/// def trezor.crypto.curve.nist256p1.sign(secret_key: bytes, message: bytes) -> bytes +/// def trezor.crypto.curve.nist256p1.sign(secret_key: bytes, message: bytes) -> bytes: /// ''' /// Uses secret key to produce the signature of message. /// ''' @@ -66,7 +66,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Nist256p1_sign(mp_obj_t self, mp_obj_t secret_k } STATIC MP_DEFINE_CONST_FUN_OBJ_3(mod_TrezorCrypto_Nist256p1_sign_obj, mod_TrezorCrypto_Nist256p1_sign); -/// def trezor.crypto.curve.nist256p1.verify(public_key: bytes, signature: bytes, message: bytes) -> bool +/// def trezor.crypto.curve.nist256p1.verify(public_key: bytes, signature: bytes, message: bytes) -> bool: /// ''' /// Uses public key to verify the signature of the message /// Returns True on success. diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h b/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h index 109eb79225..bbb17ea80f 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h @@ -20,7 +20,7 @@ typedef struct _mp_obj_Pbkdf2_t { STATIC mp_obj_t mod_TrezorCrypto_Pbkdf2_update(mp_obj_t self, mp_obj_t data); -/// def trezor.crypto.pbkdf2(prf: str, password: bytes, salt: bytes, iterations: int=None) -> Pbkdf2 +/// def trezor.crypto.pbkdf2(prf: str, password: bytes, salt: bytes, iterations: int=None) -> Pbkdf2: STATIC mp_obj_t mod_TrezorCrypto_Pbkdf2_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 3, 4, false); mp_obj_Pbkdf2_t *o = m_new_obj(mp_obj_Pbkdf2_t); @@ -52,7 +52,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Pbkdf2_make_new(const mp_obj_type_t *type, size return MP_OBJ_FROM_PTR(o); } -/// def Pbkdf2.update(self, iterations: int) -> None +/// def trezor.crypto.pbkdf2.Pbkdf2.update(self, iterations: int) -> None: STATIC mp_obj_t mod_TrezorCrypto_Pbkdf2_update(mp_obj_t self, mp_obj_t iterations) { mp_obj_Pbkdf2_t *o = MP_OBJ_TO_PTR(self); uint32_t iter = mp_obj_get_int(iterations); @@ -66,7 +66,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Pbkdf2_update(mp_obj_t self, mp_obj_t iteration } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorCrypto_Pbkdf2_update_obj, mod_TrezorCrypto_Pbkdf2_update); -/// def Pbkdf2.key(self) -> bytes +/// def trezor.crypto.pbkdf2.Pbkdf2.key(self) -> bytes: STATIC mp_obj_t mod_TrezorCrypto_Pbkdf2_key(mp_obj_t self) { mp_obj_Pbkdf2_t *o = MP_OBJ_TO_PTR(self); vstr_t vstr; diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-random.h b/extmod/modtrezorcrypto/modtrezorcrypto-random.h index e38a848aab..d1141fdbf2 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-random.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-random.h @@ -20,7 +20,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Random_make_new(const mp_obj_type_t *type, size return MP_OBJ_FROM_PTR(o); } -/// def trezor.crypto.random.uniform(n: int) -> int +/// def trezor.crypto.random.uniform(n: int) -> int: /// ''' /// Compute uniform random number from interval 0 ... n - 1 /// ''' @@ -33,7 +33,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Random_uniform(mp_obj_t self, mp_obj_t n) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorCrypto_Random_uniform_obj, mod_TrezorCrypto_Random_uniform); -/// def trezor.crypto.random.bytes(len: int) -> bytes +/// def trezor.crypto.random.bytes(len: int) -> bytes: /// ''' /// Generate random bytes sequence of length len /// ''' @@ -46,7 +46,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Random_bytes(mp_obj_t self, mp_obj_t len) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorCrypto_Random_bytes_obj, mod_TrezorCrypto_Random_bytes); -/// def trezor.crypto.random.shuffle(data: list) -> None +/// def trezor.crypto.random.shuffle(data: list) -> None: /// ''' /// Shuffles items of given list (in-place) /// ''' diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h b/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h index 02e32f9eaf..bfae67dbca 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h @@ -19,7 +19,7 @@ typedef struct _mp_obj_Ripemd160_t { STATIC mp_obj_t mod_TrezorCrypto_Ripemd160_update(mp_obj_t self, mp_obj_t data); -/// def trezor.crypto.hashlib.ripemd160(data: bytes=None) -> Ripemd160 +/// def trezor.crypto.hashlib.ripemd160(data: bytes=None) -> Ripemd160: /// ''' /// Creates a hash context object. /// ''' @@ -35,7 +35,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Ripemd160_make_new(const mp_obj_type_t *type, s return MP_OBJ_FROM_PTR(o); } -/// def Ripemd160.update(self, data: bytes) -> None +/// def trezor.crypto.hashlib.Ripemd160.update(self, data: bytes) -> None: /// ''' /// Update the hash context with hashed data. /// ''' @@ -48,7 +48,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Ripemd160_update(mp_obj_t self, mp_obj_t data) } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorCrypto_Ripemd160_update_obj, mod_TrezorCrypto_Ripemd160_update); -/// def Ripemd160.digest(self) -> bytes +/// def trezor.crypto.hashlib.Ripemd160.digest(self) -> bytes: /// ''' /// Returns the digest of hashed data. /// ''' diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h b/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h index dd335e9e3e..2837688578 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h @@ -21,7 +21,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Secp256k1_make_new(const mp_obj_type_t *type, s return MP_OBJ_FROM_PTR(o); } -/// def trezor.crypto.curve.secp256k1.publickey(secret_key: bytes, compressed: bool=True) -> bytes +/// def trezor.crypto.curve.secp256k1.publickey(secret_key: bytes, compressed: bool=True) -> bytes: /// ''' /// Computes public key from secret key. /// ''' @@ -44,7 +44,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Secp256k1_publickey(size_t n_args, const mp_obj } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorCrypto_Secp256k1_publickey_obj, 2, 3, mod_TrezorCrypto_Secp256k1_publickey); -/// def trezor.crypto.curve.secp256k1.sign(secret_key: bytes, message: bytes) -> bytes +/// def trezor.crypto.curve.secp256k1.sign(secret_key: bytes, message: bytes) -> bytes: /// ''' /// Uses secret key to produce the signature of message. /// ''' @@ -66,7 +66,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Secp256k1_sign(mp_obj_t self, mp_obj_t secret_k } STATIC MP_DEFINE_CONST_FUN_OBJ_3(mod_TrezorCrypto_Secp256k1_sign_obj, mod_TrezorCrypto_Secp256k1_sign); -/// def trezor.crypto.curve.secp256k1.verify(public_key: bytes, signature: bytes, message: bytes) -> bool +/// def trezor.crypto.curve.secp256k1.verify(public_key: bytes, signature: bytes, message: bytes) -> bool: /// ''' /// Uses public key to verify the signature of the message /// Returns True on success. diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h b/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h index 6a35e53dfb..9f2d1aec8e 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h @@ -19,7 +19,7 @@ typedef struct _mp_obj_Sha256_t { STATIC mp_obj_t mod_TrezorCrypto_Sha256_update(mp_obj_t self, mp_obj_t data); -/// def trezor.crypto.hashlib.sha256(data: bytes=None) -> Sha256 +/// def trezor.crypto.hashlib.sha256(data: bytes=None) -> Sha256: /// ''' /// Creates a hash context object. /// ''' @@ -35,7 +35,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Sha256_make_new(const mp_obj_type_t *type, size return MP_OBJ_FROM_PTR(o); } -/// def Sha256.update(self, data: bytes) -> None +/// def trezor.crypto.hashlib.Sha256.update(self, data: bytes) -> None: /// ''' /// Update the hash context with hashed data. /// ''' @@ -48,7 +48,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Sha256_update(mp_obj_t self, mp_obj_t data) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorCrypto_Sha256_update_obj, mod_TrezorCrypto_Sha256_update); -/// def Sha256.digest(self) -> bytes +/// def trezor.crypto.hashlib.Sha256.digest(self) -> bytes: /// ''' /// Returns the digest of hashed data. /// ''' diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h b/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h index cbb6c90ae4..6af4d6240e 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h @@ -19,7 +19,7 @@ typedef struct _mp_obj_Sha3_256_t { STATIC mp_obj_t mod_TrezorCrypto_Sha3_256_update(mp_obj_t self, mp_obj_t data); -/// def trezor.crypto.hashlib.sha3_256(data: bytes=None) -> Sha3_256 +/// def trezor.crypto.hashlib.sha3_256(data: bytes=None) -> Sha3_256: /// ''' /// Creates a hash context object. /// ''' @@ -35,7 +35,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Sha3_256_make_new(const mp_obj_type_t *type, si return MP_OBJ_FROM_PTR(o); } -/// def Sha3_256.update(self, data: bytes) -> None +/// def trezor.crypto.hashlib.Sha3_256.update(self, data: bytes) -> None: /// ''' /// Update the hash context with hashed data. /// ''' @@ -48,7 +48,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Sha3_256_update(mp_obj_t self, mp_obj_t data) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorCrypto_Sha3_256_update_obj, mod_TrezorCrypto_Sha3_256_update); -/// def Sha3_256.digest(self) -> bytes +/// def trezor.crypto.hashlib.Sha3_256.digest(self) -> bytes: /// ''' /// Returns the digest of hashed data. /// ''' diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h b/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h index ab8bda2eff..68ced3ab60 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h @@ -19,7 +19,7 @@ typedef struct _mp_obj_Sha3_512_t { STATIC mp_obj_t mod_TrezorCrypto_Sha3_512_update(mp_obj_t self, mp_obj_t data); -/// def trezor.crypto.hashlib.sha3_512(data: bytes=None) -> Sha3_512 +/// def trezor.crypto.hashlib.sha3_512(data: bytes=None) -> Sha3_512: /// ''' /// Creates a hash context object. /// ''' @@ -35,7 +35,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Sha3_512_make_new(const mp_obj_type_t *type, si return MP_OBJ_FROM_PTR(o); } -/// def Sha3_512.update(self, data: bytes) -> None +/// def trezor.crypto.hashlib.Sha3_512.update(self, data: bytes) -> None: /// ''' /// Update the hash context with hashed data. /// ''' @@ -48,7 +48,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Sha3_512_update(mp_obj_t self, mp_obj_t data) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorCrypto_Sha3_512_update_obj, mod_TrezorCrypto_Sha3_512_update); -/// def Sha3_512.digest(self) -> bytes +/// def trezor.crypto.hashlib.Sha3_512.digest(self) -> bytes: /// ''' /// Returns the digest of hashed data. /// ''' diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h b/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h index 11ab1c452e..3faf0279e4 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h @@ -19,7 +19,7 @@ typedef struct _mp_obj_Sha512_t { STATIC mp_obj_t mod_TrezorCrypto_Sha512_update(mp_obj_t self, mp_obj_t data); -/// def trezor.crypto.hashlib.sha512(data: bytes=None) -> Sha512 +/// def trezor.crypto.hashlib.sha512(data: bytes=None) -> Sha512: /// ''' /// Creates a hash context object. /// ''' @@ -34,7 +34,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Sha512_make_new(const mp_obj_type_t *type, size return MP_OBJ_FROM_PTR(o); } -/// def Sha512.hash(self, data: bytes) -> None +/// def trezor.crypto.hashlib.Sha512.hash(self, data: bytes) -> None: /// ''' /// Update the hash context with hashed data. /// ''' @@ -47,7 +47,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Sha512_update(mp_obj_t self, mp_obj_t data) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorCrypto_Sha512_update_obj, mod_TrezorCrypto_Sha512_update); -/// def Sha512.digest(self) -> bytes +/// def trezor.crypto.hashlib.Sha512.digest(self) -> bytes: /// ''' /// Returns the digest of hashed data. /// ''' diff --git a/extmod/modtrezorcrypto/modtrezorcrypto-ssss.h b/extmod/modtrezorcrypto/modtrezorcrypto-ssss.h index 54b3e1174f..3b33e5116c 100644 --- a/extmod/modtrezorcrypto/modtrezorcrypto-ssss.h +++ b/extmod/modtrezorcrypto/modtrezorcrypto-ssss.h @@ -21,7 +21,7 @@ STATIC mp_obj_t mod_TrezorCrypto_SSSS_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(o); } -/// def trezor.crypto.ssss.split(m: int, n: int, secret: bytes) -> tuple +/// def trezor.crypto.ssss.split(m: int, n: int, secret: bytes) -> tuple: /// ''' /// Split secret to (M of N) shares using Shamir's Secret Sharing Scheme /// ''' @@ -53,7 +53,7 @@ STATIC mp_obj_t mod_TrezorCrypto_SSSS_split(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorCrypto_SSSS_split_obj, 4, 4, mod_TrezorCrypto_SSSS_split); -/// def trezor.crypto.ssss.combine(shares: tuple) -> bytes +/// def trezor.crypto.ssss.combine(shares: tuple) -> bytes: /// ''' /// Combine M shares of Shamir's Secret Sharing Scheme into secret /// ''' diff --git a/extmod/modtrezordebug/modtrezordebug.c b/extmod/modtrezordebug/modtrezordebug.c index 45ddcca013..61e6caae6c 100644 --- a/extmod/modtrezordebug/modtrezordebug.c +++ b/extmod/modtrezordebug/modtrezordebug.c @@ -27,7 +27,7 @@ STATIC mp_obj_t mod_TrezorDebug_Debug_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(o); } -/// def trezor.debug.memaccess(address: int, length: int) -> bytes +/// def trezor.debug.memaccess(address: int, length: int) -> bytes: /// ''' /// Creates a bytes object that can be used to access certain memory location. /// ''' diff --git a/extmod/modtrezormsg/modtrezormsg.c b/extmod/modtrezormsg/modtrezormsg.c index e768c56201..9dbd9c4995 100644 --- a/extmod/modtrezormsg/modtrezormsg.c +++ b/extmod/modtrezormsg/modtrezormsg.c @@ -36,7 +36,7 @@ STATIC mp_obj_t mod_TrezorMsg_Msg_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(o); } -/// def trezor.msg.setup(ifaces: list) -> None +/// def trezor.msg.setup(ifaces: list) -> None: /// ''' /// Configures USB interfaces with a list of tuples (interface_number, usage_page) /// ''' @@ -67,7 +67,7 @@ STATIC mp_obj_t mod_TrezorMsg_Msg_setup(mp_obj_t self, mp_obj_t ifaces) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorMsg_Msg_setup_obj, mod_TrezorMsg_Msg_setup); -/// def trezor.msg.send(iface: int, message: bytes) -> int +/// def trezor.msg.send(iface: int, message: bytes) -> int: /// ''' /// Sends message using USB HID (device) or UDP (emulator). /// ''' @@ -83,7 +83,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(mod_TrezorMsg_Msg_send_obj, mod_TrezorMsg_Msg_s #define TICK_RESOLUTION 1000 #define TOUCH_IFACE 256 -/// def trezor.msg.select(timeout_us: int) -> tuple +/// def trezor.msg.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/extmod/modtrezorui/modtrezorui-display.h b/extmod/modtrezorui/modtrezorui-display.h index cc37127106..75ae0cf464 100644 --- a/extmod/modtrezorui/modtrezorui-display.h +++ b/extmod/modtrezorui/modtrezorui-display.h @@ -21,7 +21,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(o); } -/// def trezor.ui.display.bar(x: int, y: int, w: int, h: int, fgcolor: int, bgcolor: int=None, radius: int=None) -> None +/// def trezor.ui.display.bar(x: int, y: int, w: int, h: int, fgcolor: int, bgcolor: int=None, radius: int=None) -> None: /// ''' /// Renders a bar at position (x,y = upper left corner) with width w and height h of color fgcolor. /// When a bgcolor is set, the bar is drawn with rounded corners and bgcolor is used for background. @@ -46,7 +46,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_bar(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorUi_Display_bar_obj, 6, 8, mod_TrezorUi_Display_bar); -/// def trezor.ui.display.blit(x: int, y: int, w: int, h: int, data: bytes) -> None +/// def trezor.ui.display.blit(x: int, y: int, w: int, h: int, data: bytes) -> None: /// ''' /// Renders rectangle at position (x,y = upper left corner) with width w and height h with data. /// The data needs to have the correct format. @@ -66,7 +66,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_blit(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorUi_Display_blit_obj, 6, 6, mod_TrezorUi_Display_blit); -/// def trezor.ui.display.image(x: int, y: int, image: bytes) -> None +/// def trezor.ui.display.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. @@ -94,7 +94,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_image(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorUi_Display_image_obj, 4, 4, mod_TrezorUi_Display_image); -/// def trezor.ui.display.icon(x: int, y: int, icon: bytes, fgcolor: int, bgcolor: int) -> None +/// def trezor.ui.display.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. @@ -124,7 +124,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_icon(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorUi_Display_icon_obj, 6, 6, mod_TrezorUi_Display_icon); -/// def trezor.ui.display.text(x: int, y: int, text: bytes, font: int, fgcolor: int, bgcolor: int) -> None +/// def trezor.ui.display.text(x: int, y: int, text: bytes, 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. @@ -142,7 +142,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_text(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorUi_Display_text_obj, 7, 7, mod_TrezorUi_Display_text); -/// def trezor.ui.display.text_center(x: int, y: int, text: bytes, font: int, fgcolor: int, bgcolor: int) -> None +/// def trezor.ui.display.text_center(x: int, y: int, text: bytes, 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. @@ -161,7 +161,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_text_center(size_t n_args, const mp_obj_t * } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorUi_Display_text_center_obj, 7, 7, mod_TrezorUi_Display_text_center); -/// def trezor.ui.display.text_right(x: int, y: int, text: bytes, font: int, fgcolor: int, bgcolor: int) -> None +/// def trezor.ui.display.text_right(x: int, y: int, text: bytes, 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. @@ -180,7 +180,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_text_right(size_t n_args, const mp_obj_t *a } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorUi_Display_text_right_obj, 7, 7, mod_TrezorUi_Display_text_right); -/// def trezor.ui.display.text_width(text: bytes, font: int) -> int +/// def trezor.ui.display.text_width(text: bytes, font: int) -> int: /// ''' /// Returns a width of text in pixels. Font font is used for rendering. /// ''' @@ -193,7 +193,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_text_width(mp_obj_t self, mp_obj_t text, mp } STATIC MP_DEFINE_CONST_FUN_OBJ_3(mod_TrezorUi_Display_text_width_obj, mod_TrezorUi_Display_text_width); -/// def trezor.ui.display.qrcode(x: int, y: int, data: bytes, scale: int) -> None +/// def trezor.ui.display.qrcode(x: int, y: int, data: bytes, scale: int) -> None: /// ''' /// Renders data encoded as a QR code at position (x,y). /// Scale determines a zoom factor. @@ -212,7 +212,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_qrcode(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorUi_Display_qrcode_obj, 5, 5, mod_TrezorUi_Display_qrcode); -/// def trezor.ui.display.loader(progress: int, fgcolor: int, bgcolor: int, icon: bytes=None, iconfgcolor: int=None) -> None +/// def trezor.ui.display.loader(progress: 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. @@ -253,7 +253,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_loader(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorUi_Display_loader_obj, 4, 6, mod_TrezorUi_Display_loader); -/// def trezor.ui.display.orientation(degrees: int=None) -> int +/// def trezor.ui.display.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. @@ -274,7 +274,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_orientation(size_t n_args, const mp_obj_t * } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorUi_Display_orientation_obj, 1, 2, mod_TrezorUi_Display_orientation); -/// def trezor.ui.display.backlight(val: int=None) -> int +/// def trezor.ui.display.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. @@ -294,7 +294,7 @@ STATIC mp_obj_t mod_TrezorUi_Display_backlight(size_t n_args, const mp_obj_t *ar } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_TrezorUi_Display_backlight_obj, 1, 2, mod_TrezorUi_Display_backlight); -/// def trezor.ui.display.raw(reg: int, data: bytes) -> None +/// def trezor.ui.display.raw(reg: int, data: bytes) -> None: /// ''' /// Performs a raw command on the display. Read the datasheet to learn more. /// '''