%%%% Example of the computation of the success probability. %%%% For the parameters of the attack on PUFFIN2 when inverting 5 rounds %%% number of message bits m=64; %%% number of key candidates n=2^(74); %%% total number of differences used in the attack numberofdifferences=210; %%% number of input differences D0=137; %%% probability for the correct key candidate counter distribution pstar=2^(-57.7949); %%% size of the list of kept candidates l=2^(66.5); %%% probability for wrong key candidate counter distributions p=2^(-m)*numberofdifferences/D0; Ndata=Nprime(pstar,p,D0,l,n); Ns=D0*Ndata/2; ps=PS(pstar,p,Ns,l,n); fprintf('Multiple differential cryptanalysis on PUFFIN2 when inverting 5 rounds\n'); fprintf('Parameters:\n'); fprintf('\t key candidates:\t\t 2^%.1f\n',log(n)/log(2)); fprintf('\t size of the list:\t\t 2^%.1f\n',log(l)/log(2)); fprintf('\t number of differences: \t %d\n',numberofdifferences); fprintf('\t number of input differences:\t %d\n',D0); fprintf('\t p_star: \t\t\t 2^%.2f\n',log(pstar)/log(2)); fprintf('\t p:\t\t\t\t 2^%.2f\n',log(p)/log(2)); fprintf('Results:\n'); fprintf('\t Ndata=2^%.2f PS=%.2f\n',log(Ndata)/log(2),ps);