mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-26 08:08:51 +00:00
storage: explicitly reseed in PRNG tests
This commit is contained in:
parent
eaf1e940a8
commit
cb99a175ea
@ -1,8 +0,0 @@
|
||||
from ..src import prng
|
||||
|
||||
|
||||
def pytest_runtest_teardown(item):
|
||||
"""
|
||||
Called after each test ran to reset the PRNG
|
||||
"""
|
||||
prng.seed = 0
|
@ -1,7 +1,9 @@
|
||||
from ..src import pin_log
|
||||
from ..src import pin_log, prng
|
||||
|
||||
|
||||
def test_generate_guard_key():
|
||||
prng.random_reseed(0)
|
||||
|
||||
p = pin_log.PinLog(None)
|
||||
|
||||
assert p._generate_guard_key() == 2267428717
|
||||
|
@ -2,6 +2,8 @@ from ..src import prng
|
||||
|
||||
|
||||
def test_prng():
|
||||
prng.random_reseed(0)
|
||||
|
||||
buf = prng.random_buffer(4)
|
||||
assert buf == b"\x5f\xf3\x6e\x3c"
|
||||
buf = prng.random_buffer(4)
|
||||
|
Loading…
Reference in New Issue
Block a user