mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-23 07:58:09 +00:00
19 lines
445 B
Python
19 lines
445 B
Python
|
|
# 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)
|
|
'''
|