mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-31 19:08:28 +00:00
fixup! refactor(python): implement anti-exfil protocol helper functions
This commit is contained in:
parent
767774f479
commit
5176d5950c
@ -1,3 +1,4 @@
|
|||||||
|
import secrets
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from hashlib import sha256
|
from hashlib import sha256
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
@ -13,9 +14,7 @@ class AntiExfilSignature:
|
|||||||
|
|
||||||
|
|
||||||
def generate_entropy() -> bytes:
|
def generate_entropy() -> bytes:
|
||||||
import os
|
return secrets.token_bytes(32)
|
||||||
|
|
||||||
return os.urandom(32)
|
|
||||||
|
|
||||||
|
|
||||||
def sha256_data(message: bytes) -> bytes:
|
def sha256_data(message: bytes) -> bytes:
|
||||||
|
Loading…
Reference in New Issue
Block a user