mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-13 18:18:08 +00:00
11 lines
297 B
Python
11 lines
297 B
Python
from storage import cache
|
|
from trezor import wire
|
|
from trezor.crypto import random
|
|
from trezor.messages import GetNonce, Nonce
|
|
|
|
|
|
async def get_nonce(ctx: wire.Context, msg: GetNonce) -> Nonce:
|
|
nonce = random.bytes(32)
|
|
cache.set(cache.APP_COMMON_NONCE, nonce)
|
|
return Nonce(nonce=nonce)
|