From bce859683fb8c83aaa9b35ed9e724a326d5b612e Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Wed, 10 Oct 2018 16:54:31 +0200 Subject: [PATCH] modtrezorcrypto: define mock package --- embed/extmod/modtrezorcrypto/modtrezorcrypto-aes.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-blake256.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h | 2 ++ .../extmod/modtrezorcrypto/modtrezorcrypto-chacha20poly1305.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-curve25519.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-groestl.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-monero.h | 3 +++ embed/extmod/modtrezorcrypto/modtrezorcrypto-nem.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-random.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-rfc6979.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-sha1.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h | 2 ++ embed/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h | 2 ++ 23 files changed, 47 insertions(+) diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-aes.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-aes.h index 5671d3ab9..aea3c25d9 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-aes.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-aes.h @@ -30,6 +30,8 @@ enum AESMode { CTR = 0x04, }; +/// package: trezorcrypto.__init__ + /// class AES: /// ''' /// AES context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h index 2b03b6990..76f696b1d 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h @@ -27,6 +27,8 @@ #include "memzero.h" #include "nem.h" +/// package: trezorcrypto.bip32 + /// class HDNode: /// ''' /// BIP0032 HD node structure. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h index e6f412f3d..fb245dece 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h @@ -21,6 +21,8 @@ #include "bip39.h" +/// package: trezorcrypto.bip39 + /// def find_word(prefix: str) -> Optional[str]: /// ''' /// Return the first word from the wordlist starting with prefix. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake256.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake256.h index d15c2ca78..d7937cd4e 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake256.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake256.h @@ -22,6 +22,8 @@ #include "blake256.h" #include "memzero.h" +/// package: trezorcrypto.__init__ + /// class Blake256: /// ''' /// Blake256 context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h index d860237e4..ea61853d2 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h @@ -24,6 +24,8 @@ #include "blake2b.h" #include "memzero.h" +/// package: trezorcrypto.__init__ + /// class Blake2b: /// ''' /// Blake2b context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h index fb14b352a..497109025 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h @@ -24,6 +24,8 @@ #include "blake2s.h" #include "memzero.h" +/// package: trezorcrypto.__init__ + /// class Blake2s: /// ''' /// Blake2s context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-chacha20poly1305.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-chacha20poly1305.h index 9b4a04c4d..98563f5bc 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-chacha20poly1305.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-chacha20poly1305.h @@ -22,6 +22,8 @@ #include "chacha20poly1305/rfc7539.h" #include "memzero.h" +/// package: trezorcrypto.__init__ + /// class ChaCha20Poly1305: /// ''' /// ChaCha20Poly1305 context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-curve25519.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-curve25519.h index 653234b2f..bd24e6fcb 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-curve25519.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-curve25519.h @@ -23,6 +23,8 @@ #include "rand.h" +/// package: trezorcrypto.curve25519 + /// def generate_secret() -> bytes: /// ''' /// Generate secret key. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h index e042ca4b1..8ed1f5ea6 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h @@ -24,6 +24,8 @@ #include "rand.h" +/// package: trezorcrypto.ed25519 + /// def generate_secret() -> bytes: /// ''' /// Generate secret key. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-groestl.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-groestl.h index f9e4794f8..87071f5e6 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-groestl.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-groestl.h @@ -25,6 +25,8 @@ #define GROESTL512_DIGEST_LENGTH 64 #define GROESTL512_BLOCK_LENGTH 128 +/// package: trezorcrypto.__init__ + /// class Groestl512: /// ''' /// GROESTL512 context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-monero.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-monero.h index aa67e4ddf..2a68566cf 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-monero.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-monero.h @@ -24,6 +24,9 @@ #include "monero/monero.h" #include "bignum.h" +/// package: trezorcrypto.monero + + typedef struct _mp_obj_hasher_t { mp_obj_base_t base; diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-nem.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-nem.h index 57d199029..11fa0b01d 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-nem.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-nem.h @@ -23,6 +23,8 @@ #include "nem.h" +/// package: trezorcrypto.nem + /// def validate_address(address: str, network: int) -> bool: /// ''' /// Validate a NEM address diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h index ee1cb1c74..8c6b5e5c1 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h @@ -22,6 +22,8 @@ #include "ecdsa.h" #include "nist256p1.h" +/// package: trezorcrypto.nist256p1 + /// def generate_secret() -> bytes: /// ''' /// Generate secret key. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h index ca48e400f..f941f9ed9 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-pbkdf2.h @@ -25,6 +25,8 @@ #define PRF_HMAC_SHA256 256 #define PRF_HMAC_SHA512 512 +/// package: trezorcrypto.__init__ + /// class Pbkdf2: /// ''' /// PBKDF2 context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-random.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-random.h index 288d8cbac..57e00bd83 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-random.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-random.h @@ -23,6 +23,8 @@ #include "rand.h" +/// package: trezorcrypto.random + /// def uniform(n: int) -> int: /// ''' /// Compute uniform random number from interval 0 ... n - 1. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-rfc6979.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-rfc6979.h index 1662993f1..f89294de0 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-rfc6979.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-rfc6979.h @@ -21,6 +21,8 @@ #include "rfc6979.h" +/// package: trezorcrypto.__init__ + /// class Rfc6979: /// ''' /// RFC6979 context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h index 76797d94d..9aba1238f 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-ripemd160.h @@ -22,6 +22,8 @@ #include "ripemd160.h" #include "memzero.h" +/// package: trezorcrypto.__init__ + /// class Ripemd160: /// ''' /// RIPEMD160 context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h index 5a1bc6de7..da0885470 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h @@ -22,6 +22,8 @@ #include "ecdsa.h" #include "secp256k1.h" +/// package: trezorcrypto.secp256k1 + /// def generate_secret() -> bytes: /// ''' /// Generate secret key. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha1.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha1.h index a9d8e584e..fff30dbfc 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha1.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha1.h @@ -22,6 +22,8 @@ #include "sha2.h" #include "memzero.h" +/// package: trezorcrypto.__init__ + /// class Sha1: /// ''' /// SHA1 context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h index 9d4acacbc..98c1d1caa 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha256.h @@ -22,6 +22,8 @@ #include "sha2.h" #include "memzero.h" +/// package: trezorcrypto.__init__ + /// class Sha256: /// ''' /// SHA256 context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h index c55333434..a76173953 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-256.h @@ -22,6 +22,8 @@ #include "sha3.h" #include "memzero.h" +/// package: trezorcrypto.__init__ + /// class Sha3_256: /// ''' /// SHA3_256 context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h index dd51e3c7c..e374ad1c7 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha3-512.h @@ -22,6 +22,8 @@ #include "sha3.h" #include "memzero.h" +/// package: trezorcrypto.__init__ + /// class Sha3_512: /// ''' /// SHA3_512 context. diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h index 70489ce48..09d7ac75a 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-sha512.h @@ -22,6 +22,8 @@ #include "sha2.h" #include "memzero.h" +/// package: trezorcrypto.__init__ + /// class Sha512: /// ''' /// SHA512 context.