refactor; rename classes and methods

This commit is contained in:
2025-03-10 09:26:55 -05:00
parent c1ca01eb93
commit 571268b86a
15 changed files with 160 additions and 160 deletions

View File

@@ -1,7 +1,7 @@
from dataclasses import dataclass, field
from src.models import EncipheredNKode
from src.customer_attributes import CustomerAttributes
from src.user_cipher_keys import UserCipherKeys
from src.customer_cipher import CustomerCipher
from src.user_cipher_keys import UserCipher
from src.user_keypad import UserKeypad
from src.utils import xor_lists
@@ -10,7 +10,7 @@ from src.utils import xor_lists
class User:
username: str
enciphered_passcode: EncipheredNKode
user_keys: UserCipherKeys
user_keys: UserCipher
user_keypad: UserKeypad
renew: bool = field(default=False)
@@ -19,10 +19,10 @@ class User:
self.user_keys.set_key = xor_lists(self.user_keys.set_key, sets_xor)
self.user_keys.alpha_key = xor_lists(self.user_keys.alpha_key, attrs_xor)
def refresh_passcode(self, passcode_attr_idx: list[int], customer_attributes: CustomerAttributes):
self.user_keys = UserCipherKeys.create(
def refresh_passcode(self, passcode_attr_idx: list[int], customer_attributes: CustomerCipher):
self.user_keys = UserCipher.create(
customer_attributes.keypad_size,
customer_attributes.set_vals,
customer_attributes.set_key,
self.user_keys.max_nkode_len
)
self.enciphered_passcode = self.user_keys.encipher_nkode(passcode_attr_idx, customer_attributes)