Shifting window

In the shifting window example from Kawamoto et al.  the secret can take N possible values, and an interval (called a “window”) in the secret domain is randomly selected from 1 to W.
If the value of the secret is inside the window, then another window is randomly chosen in a similar way and the program outputs a random value from this second window.
Otherwise, the program outputs a random value over the secret domain. The input code is as follows:

const N:=16;
const W:=14;
secret int32 sec := [0,N-1];
public int32 minS;
public int32 sizeS;
observable int32 obs;
public int32 minO;
public int32 sizeO;
random minS := random(0,N-W-1);
if (sec>=minS) then
random sizeS := random(1,W);
if (sec<=(minS+sizeS)) then
random minO := random(0,N-W-1);
random sizeO := random(1,W);
random obs := random(minO,minO+sizeO);
else
random obs := random(0,N-1);
fi
else
random obs := random(0,N-1);
fi
return;

In the figures below we present the results of experiments on the shifting window when increasing the size of the secret domain. The execution time of precise analysis grows proportionally to the secret domain size N while HyLeak and fully statistical analysis do not require much time for a larger N. However, in the fully statistical analysis the error from the true value grows rapidly while in using HyLeak the error is much smaller.

Comments are closed.