The source code is provided here as is, for research purposes only. It was developped in C++, using some advanced features of C++11, so a (partially) compliant compiler is necessary. Both codes are used as a library part, and can be used as illustrated below: #include "Enumeration.h" [...] Enumeration<> myEnum(keyPMF); // enumeration object bool found = false; unsigned long long rank = 0; pair> candidate; // key candidate while (!found) { candidate = myEnum.nextCandidate(); // enumerate next candidate found = testKey(candidate.second); #include "RankKey.h" [...] RankKey rankEstimation(keyPMF, posteriorProbability); rankEstim.mergeDistribution(24); // merge lists up to 2^24 auto estimation = rankEstim(10); // estimate key rank for 10 seconds for(auto& v0 : estimation) // output log2 estimations of rank cout << log((double)v0) / log(2) << ' '; cout << endl; The output of this code will look like this: "90.135416 -inf 89.784516", meaning that the key rank is inside [2^89.7;2^90.2], and that no candidates with the exact key probability were found (yet). The matlab hooks are to be compiled using the mex function. The first function takes a posterior key distribution matrix (16x256), and the number of keys to enumerate it returns a matrix where each row contains a candidate key. mex keyEnumeration.cpp -f ./gccopts.sh The second function takes a posterior key distribution matrix (16x256), a target key and an enumeration limit it enumerates keys until the correct key is found, and returns its rank or the enumeration limit (whichever is lower). mex keyEnumerationRank.cpp -f ./gccopts.sh The last function takes a posterior key distribution matrix (16x256), the probability of the target key, the enumeration convergence time (in seconds) and optionnally a merge parameter for sublists. It returns a log2 estimate for the bounds on the target key rank (upper, equal, lower). mex rankEstimation.cpp ../Rank/RankKey.cpp ../Rank/KeyTope.cpp ../Rank/TopeQueue.cpp -f ./gccopts.sh