You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/src/trezor/crypto/__init__.py

30 lines
499 B

from gc import collect
from trezorcrypto import ( # noqa: F401
aes,
bip32,
bip39,
chacha20poly1305,
crc,
monero,
nem,
pbkdf2,
random,
rfc6979,
)
class SecureContext:
def __init__(self):
pass
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
for k in self.__dict__:
o = getattr(self, k)
if hasattr(o, "__del__"):
o.__del__()
collect()