Skip to content

Commit

Permalink
Changed pytests to match model size change due to new XOR inequalitie…
Browse files Browse the repository at this point in the history
…s file
  • Loading branch information
p-huynh committed Jun 10, 2024
1 parent 13e74a9 commit cba46de
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion claasp/cipher_modules/models/milp/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def milp_xor_truncated(model, input_1, input_2, output):

def milp_xor_truncated_wordwise(model, input_1, input_2, output):
"""
Returns a list of variables and a list of constraints for the XOR for two input words
Returns a list of variables and a list of constraints for the XOR for two input bytes
in deterministic truncated XOR differential model.
This method uses a binary encoding (where each variable v is seen as a binary tuple (v0, v1), where v0 is the MSB) to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_build_wordwise_deterministic_truncated_xor_differential_trail_model():
milp.build_wordwise_deterministic_truncated_xor_differential_trail_model()
constraints = milp.model_constraints

assert len(constraints) == 43960
assert len(constraints) == 19768
assert str(constraints[0]) == '1 <= 1 + x_0 - x_1 + x_2 + x_3 + x_4 + x_5 + x_6 + x_7 + x_8 + x_9'
assert str(constraints[1]) == '1 <= 1 + x_1 - x_9'
assert str(constraints[-2]) == 'x_3062 == x_2886'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_build_wordwise_impossible_xor_differential_trail_model():

constraints = milp.model_constraints

assert len(constraints) == 48392
assert len(constraints) == 24200
assert str(constraints[0]) == '1 <= 1 + x_0 - x_1 + x_2 + x_3 + x_4 + x_5 + x_6 + x_7 + x_8 + x_9'
assert str(constraints[1]) == '1 <= 1 + x_1 - x_9'
assert str(constraints[-2]) == 'x_3238 == x_2065'
Expand Down

0 comments on commit cba46de

Please sign in to comment.