You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// the leakage is supposed to be $$H(\frac{cases(0)}{2^n},1-\frac{cases(0)}{2^n})$$ where $$cases(0)=\sum_{k=0}^{\lfloor\frac{n}{2}\rfloor}\binom{n}{k}$$
// N is the number of voters
const N:=3;
// the output is the number of votes for one of the two candidates
observable int1 output:=0;
public int32 votecount:=0;
// these bits represent the preferences of each voter
secret array [N] of int1 vote;
// these bits represent the votes received by the voting machine
public array [N] of int1 decl;
// this is just a counter
public int32 i:=0;
// voting
while (i<N) do
if (vote[i]==0) then
assign decl[i]:=0;
else
assign decl[i]:=1;
fi
assign i:=i+1;
od
// count the number of votes for one of the candidates