Skip to content

Commit

Permalink
black format
Browse files Browse the repository at this point in the history
  • Loading branch information
GiacomoPope committed Jul 22, 2024
1 parent 514f884 commit e69ebb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion kyber/kyber.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from hashlib import sha3_256, sha3_512, shake_128, shake_256
from modules.modules import ModuleKyber


class Kyber:
def __init__(self, parameter_set, seed=None):
self.k = parameter_set["k"]
Expand Down Expand Up @@ -29,11 +30,14 @@ def set_drbg_seed(self, seed):
"""
try:
from drbg.aes256_ctr_drbg import AES256_CTR_DRBG

self.drbg = AES256_CTR_DRBG(seed)
self.random_bytes = self.drbg.random_bytes
except ImportError as e:
print(f"Error importing AES from pycryptodome: {e = }")
print("Have you tried installing requirements: pip -r install requirements")
print(
"Have you tried installing requirements: pip -r install requirements"
)

def reseed_drbg(self, seed):
"""
Expand Down
6 changes: 5 additions & 1 deletion ml_kem/ml_kem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from hashlib import sha3_256, sha3_512, shake_128, shake_256
from modules.modules import ModuleKyber


class ML_KEM:
def __init__(self, params, seed=None):
# ml-kem params
Expand Down Expand Up @@ -30,11 +31,14 @@ def set_drbg_seed(self, seed):
"""
try:
from drbg.aes256_ctr_drbg import AES256_CTR_DRBG

self.drbg = AES256_CTR_DRBG(seed)
self.random_bytes = self.drbg.random_bytes
except ImportError as e:
print(f"Error importing AES from pycryptodome: {e = }")
print("Have you tried installing requirements: pip -r install requirements")
print(
"Have you tried installing requirements: pip -r install requirements"
)

def reseed_drbg(self, seed):
"""
Expand Down

0 comments on commit e69ebb5

Please sign in to comment.