-rw-r--r-- 624 cryptattacktester-20230614/predictedprob.cpp raw
#include <iostream>
#include "problem.h"
#include "attack.h"
using namespace std;
int attack_handle(const problem &E,const vector<bigint> &P,const attack &A,const vector<bigint> &Q)
{
bigfloat predictedprob = A.prob(P,Q);
cout << "predictedprob";
cout << " problem=" << E.name;
for (bigint j = 0;j < P.size();++j)
cout << (j ? ',' : ' ') << E.paramnames.at(j) << "=" << P.at(j);
cout << " attack=";
cout << A.name;
for (bigint j = 0;j < Q.size();++j)
cout << (j ? ',' : ' ') << A.paramnames.at(j) << "=" << Q.at(j);
cout << " prediction " << predictedprob;
cout << '\n' << flush;
return 1;
}