Skip to content

Commit

Permalink
Fixed doctests for sat_xor_differential_model.py and n_window_heurist…
Browse files Browse the repository at this point in the history
…ic_helper.py
  • Loading branch information
p-huynh committed Jun 10, 2024
1 parent 482fa80 commit fc27593
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ def find_one_xor_differential_trail_with_fixed_weight(self, fixed_weight, fixed_
sage: sat = SatXorDifferentialModel(speck)
sage: sat.set_window_size_heuristic_by_round([0, 0, 0])
sage: trail = sat.find_one_xor_differential_trail_with_fixed_weight(3)
...
sage: trail['total_weight']
3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,15 @@ def generate_window_size_clauses(first_input_difference, second_input_difference
- ``c`` -- **list**: List of binary variables representing the input differences c
- ``aux`` -- **integer**: Auxiliary variable used to store the conjunctions of the carry differences from the addition of the first n - 1 bit differences of a and b
EXAMPLES:
::
EXAMPLES::
sage: from claasp.cipher_modules.models.sat.utils.n_window_heuristic_helper import generate_window_size_clauses
sage: a = [1, 2, 3, 4]
sage: b = [5, 6, 7, 8]
sage: c = [9, 10, 11, 12]
sage: aux = 10
sage: cnf = window_size_3_cnf(a, b, c, aux)
sage: cnf
sage: cnf = generate_window_size_clauses(a, b, c, aux) # doctest:+SKIP
sage: cnf # doctest:+SKIP
['4 -4 -10', '8 -10 -8']
"""
window_size_plus_one = len(first_input_difference)
Expand Down

0 comments on commit fc27593

Please sign in to comment.