#include "queue_prob.h" #include "aes128_enum_prob.h" using namespace std; bigfloat aes128_enum_prob(const vector ¶ms,const vector &attackparams) { bigint K = params.at(0); bigint C = params.at(1); bigint I = attackparams.at(0); bigint QX = attackparams.at(1); bigint QU = attackparams.at(2); bigint QF = attackparams.at(3); bigint PE = QU*QF; bigint searchspace = bigint(1)< 0)) { bigint full_clears = I/PE; bigint leftovers = I%PE; bigfloat pr0 = exp2(bigfloat(-bigint(C))); bigfloat survivors = full_clears*queue_average(PE,pr0,QU)+queue_average(leftovers,pr0,QU); result *= survivors/(pr0*bigfloat(I)); } result += bigfloat(1)/bigfloat(searchspace); if (result.definitely_positive_and_reasonably_precise()) return result; } }