Skip to content

Commit

Permalink
add PoolSolutions to check_presence_of_particular_monomial_in_specifi…
Browse files Browse the repository at this point in the history
…c_anf()
  • Loading branch information
SiMohamedRachidi committed Nov 12, 2024
1 parent 711d141 commit 5fdf7f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions claasp/cipher_modules/division_trail_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,9 @@ def find_anf_of_specific_output_bit(self, output_bit_index, fixed_degree=None, c
def check_presence_of_particular_monomial_in_specific_anf(self, monomial, output_bit_index, fixed_degree=None,
chosen_cipher_output=None):
self.build_generic_model_for_specific_output_bit(output_bit_index, fixed_degree, chosen_cipher_output)
self._model.setParam("PoolSolutions", 200000000) # 200000000 to be large
self._model.setParam(GRB.Param.PoolSearchMode, 2)

for term in monomial:
var_term = self._model.getVarByName(f"{term[0]}[{term[1]}]")
self._model.addConstr(var_term == 1)
Expand Down

0 comments on commit 5fdf7f3

Please sign in to comment.