trezor-core/mocks/trezor/crypto/random.py

19 lines
454 B
Python
Raw Normal View History

2016-09-27 07:48:21 -07:00
# ../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)
'''