-rw-r--r-- 634 cryptattacktester-20231020/bruteforce_params.cpp raw
#include "selection.h"
#include "bruteforce_params.h"
using namespace std;
void bruteforce_params(const vector<bigint> ¶ms,map<string,string> &S,int (*callback)(const vector<bigint> &))
{
bigint n = params.at(0);
bigint k = params.at(1);
bigint w = params.at(2);
bigint possibilities = binomial(n,w);
for (bigint iters = 1;iters < possibilities;iters *= 2) {
if (!selection_allows(S,"I",iters.get_str())) continue;
vector<bigint> Q{iters};
if (callback(Q) < 0) return;
}
if (selection_allows(S,"I",possibilities.get_str())) {
vector<bigint> Q{possibilities};
if (callback(Q) < 0) return;
}
}