Research Article

Differential Cryptanalysis on Block Cipher Skinny with MILP Program

Algorithm 1

#include <stdio.h>
# define N1 300
# define N2 200
# define M 9
int choose(int x[N1][M],int y[N2][M-1])
int i, j, temp;
int z[N1]=;
// How many points are not satisfied for each inequality.
for (i=0;i<N1;i++)
for(j=0;j<N2;j++)
if((x[i]]y[j]+x[i]]y[j]]+x[i]]y[j]]+x[i]]y[j]]+x[i]]y[j]]+x[i]]y[j]]
+x[i]]y[j]]+x[i]]y[j]]+x[i]])<0)
z[i]++;
temp=z; j=0;
// Finding the inequality and its count is the largest.
for(i=1;i<N1;i++)
if(z[i]>temp)
if(temp!=0)
// Delete the points corresponding to the largest inequality.
for(i=0;i<N2;i++)
if(x[j]]y[i]+x[j]]y[i]]+x[j]]y[i]]+x[j]]y[i]]+x[j]]y[i]]+x[j]]y[i]]
+x[j]]y[i]]+x[j]]y[i]]+x[j]]<0)
y[i]=0;y[i]]=0;y[i]]=0;y[i]]=0;y[i]]=0;y[i]]=0;y[i]]=0;
y[i]]=0;
// Output inequality and the number of points that are not satisfied.
for(i=0; i<8;i++)
if(x[j][i]<0∥i==0)
printf(%dx%d,x[j][i],i+1);
else
printf(+%dx%d,x[j][i],i+1);
printf(+%d%6d,x[j]],temp);printf(∖n);
x[j]=0;x[j]]=0;x[j]]=0;x[j]]=0;x[j]]=0;x[j]]=0;x[j]]=0;x[j]]=0;
x[j]]=0;
return temp;
else
return 0;
void main()
//In SageMath, the coefficients of the inequality of the s1-box are obtained.
//Because there are so many points, I’ll just list some of them here.
int a[N1][M]=;
//It doesn’t satisfy the s1-box.
//Because there are so many points, I’ll just list some of them here.
int b[N2][M-1]=;
printf(inequalities counting∖n);
while(choose(a, b)!=0)
choose(a, b);