From 5fdf7f380103b1aea4868604f953936927fae24d Mon Sep 17 00:00:00 2001 From: Mohamed Rachidi Date: Tue, 12 Nov 2024 15:56:34 +0400 Subject: [PATCH] add PoolSolutions to check_presence_of_particular_monomial_in_specific_anf() --- claasp/cipher_modules/division_trail_search.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/claasp/cipher_modules/division_trail_search.py b/claasp/cipher_modules/division_trail_search.py index 7fc63cf7..9dcf3517 100644 --- a/claasp/cipher_modules/division_trail_search.py +++ b/claasp/cipher_modules/division_trail_search.py @@ -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)