From 6f08f3f6a86560666e0cd837305e45b089b8a9df Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 31 May 2016 15:03:25 +0200 Subject: [PATCH] update docu --- docs/api.md | 26 +++++++++++++++++++++++++- docs/api.template.md | 4 ++++ extmod/modtrezormsg/modtrezormsg.c | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index d34914b9..f03a80c6 100644 --- a/docs/api.md +++ b/docs/api.md @@ -233,6 +233,21 @@ def Sha3_512.digest(self) -> bytes Returns the digest of hashed data. +####trezor.crypto.ssss + +``` python +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 + +``` python +def trezor.crypto.ssss.combine(shares: tuple) -> bytes +``` + +Combine M shares of Shamir's Secret Sharing Scheme into secret + + ###trezor.crypto.hmac ``` python @@ -257,7 +272,13 @@ Returns the digest of processed data. ##trezor.msg ``` python -def trezor.msg.send(message) -> int +def trezor.msg.setup(ifaces: list) -> None +``` + +Configures USB interfaces with a list of tuples (interface_number, usage_page) + +``` python +def trezor.msg.send(iface: int, message: bytes) -> int ``` Sends message using USB HID (device) or UDP (emulator). @@ -287,6 +308,9 @@ def trezor.ui.blend(ca: int, cb: int, t: float) -> int ``` python def trezor.ui.animate_pulse(func, ca, cb, speed=200000, delay=30000) ``` +``` python +def trezor.ui.rotate_coords(pos: tuple) -> tuple +``` ###trezor.ui.display diff --git a/docs/api.template.md b/docs/api.template.md index 1b969180..765f9b43 100644 --- a/docs/api.template.md +++ b/docs/api.template.md @@ -48,6 +48,10 @@ Syntax used below is a valid Python function declaration with type hints defined @extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h +####trezor.crypto.ssss + +@extmod/modtrezorcrypto/modtrezorcrypto-ssss.h + ###trezor.crypto.hmac @src/trezor/crypto/hmac.py diff --git a/extmod/modtrezormsg/modtrezormsg.c b/extmod/modtrezormsg/modtrezormsg.c index b071713e..3e116c21 100644 --- a/extmod/modtrezormsg/modtrezormsg.c +++ b/extmod/modtrezormsg/modtrezormsg.c @@ -38,7 +38,7 @@ STATIC mp_obj_t mod_TrezorMsg_Msg_make_new(const mp_obj_type_t *type, size_t n_a /// def trezor.msg.setup(ifaces: list) -> None /// -/// Setups USB interfaces with a list of tuples +/// Configures USB interfaces with a list of tuples (interface_number, usage_page) /// STATIC mp_obj_t mod_TrezorMsg_Msg_setup(mp_obj_t self, mp_obj_t ifaces) { mp_uint_t iface_cnt;