Skip to content

Commit

Permalink
Sat Truncated Deterministic Model: Adding tests
Browse files Browse the repository at this point in the history
Adding tests to check Sat Truncated Deterministic Model. Specifically, adding tests for ChaCha, Speck.
  • Loading branch information
juaninf committed Jan 30, 2025
1 parent 02b2a2b commit c30444c
Show file tree
Hide file tree
Showing 5 changed files with 245 additions and 203 deletions.
5 changes: 3 additions & 2 deletions claasp/cipher_modules/models/sat/sat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@

from sage.sat.solvers.satsolver import SAT

from claasp.editor import remove_permutations, remove_rotations
from claasp.cipher_modules.models.sat import solvers
from claasp.cipher_modules.models.sat.utils import utils
from claasp.cipher_modules.models.utils import set_component_solution, convert_solver_solution_to_dictionary
from claasp.editor import remove_permutations, remove_rotations
from claasp.name_mappings import SBOX, CIPHER_OUTPUT, CONSTANT, INTERMEDIATE_OUTPUT, LINEAR_LAYER, MIX_COLUMN, \
WORD_OPERATION

Expand Down Expand Up @@ -500,7 +500,8 @@ def build_generic_sat_model_from_dictionary(self, component_and_model_types):
print(f'{component.id} not yet implemented')
else:
sat_xor_differential_propagation_constraints = getattr(component, model_type)
if model_type == 'sat_bitwise_deterministic_truncated_xor_differential_constraints':
if model_type in ['sat_bitwise_deterministic_truncated_xor_differential_constraints',
'sat_semi_deterministic_truncated_xor_differential_constraints']:
variables, constraints = sat_xor_differential_propagation_constraints()
else:
variables, constraints = sat_xor_differential_propagation_constraints(self)
Expand Down
Loading

0 comments on commit c30444c

Please sign in to comment.