mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-01 20:32:35 +00:00

Squashed commit of the following: commit 84d3486f59bda063f06521c8b695ea4b07781ec6 Author: matejcik <ja@matejcik.cz> Date: Fri May 17 14:17:15 2019 +0200 mocks: complete commit d538133a6d0fb4af06c7c81f80b8675869fb5908 Author: matejcik <ja@matejcik.cz> Date: Fri May 17 14:12:26 2019 +0200 mocks part 3 commit 9f0b868d41dafaf487df6fc844db7f3368eabe1b Author: matejcik <ja@matejcik.cz> Date: Fri May 17 14:09:20 2019 +0200 mocks: update generated mocks commit 5d80c18a7824ed16fc11cde4cdb8ebca7ed33400 Author: matejcik <ja@matejcik.cz> Date: Thu May 16 15:49:40 2019 +0200 mocks wip 2 commit 4b576eb796136a61eb88cb0d281fa4e21eadada8 Author: matejcik <ja@matejcik.cz> Date: Tue May 7 17:02:51 2019 +0200 WIP mocks part 1 commit cf3f0d4471ab74b478d2970b0bb178feae7c86a3 Author: matejcik <ja@matejcik.cz> Date: Fri May 3 17:07:53 2019 +0200 core: add package to secp256k1_zkp for mocking commit 8a12f26c8c0d99363c8df96012426abbbb3ff6cb Author: matejcik <ja@matejcik.cz> Date: Fri May 3 17:04:05 2019 +0200 core: blackify extmod docstring quotes commit b6f239676dde8b60b001fcae4e5de80a71dbacf2 Author: matejcik <ja@matejcik.cz> Date: Fri May 3 16:52:27 2019 +0200 core: make build_mocks directory agnostic mocks: detect bad packages mocks: revert noqa in favor of setup.cfg mocks: fix broken comment formatting
23 lines
472 B
Python
23 lines
472 B
Python
from typing import *
|
|
|
|
|
|
# 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).
|
|
"""
|