A select statement randomly selects an element from a specified field and assigns it to a given variable name. Selection may be looped using a for statement:
PartyName selects var in FieldName
PartyName selects var[counter] in FieldName for counter := num1 to num2
Computes statements assign the result of an expression to a variable name. Computations may also be looped:
PartyName computes var := Expression
PartyName computes var[counter] := Expression for counter := num1 to num2
Send statements send a particular variable to a specified party. An as operator may specify what the local variable name will be for the receiving party:
PartyName sends var to PartyName2 PartyName sends var as var2 to PartyName2
Return statements just specify a variable name. There may be multiple return statements to return multiple values:
PartyName returns var
PartyName returns var2
Actions for identical multiple parties may be designated using an every keyword:
every PartyName[counter] computes
var[counter] := Expression
PartyName sends var[counter] to every MultiParty[counter]
This example will illustrate all the main operations. Alice selects a
random
and an array of
values in
. Alice then
computes
for each
and sends the
result to each of
identical players. The receiving players return
both the received value and its hash:
![\framebox{
\vbox{
\textbf{protocol} Example2 \\
parameters (n, p) \\
\textbf{p...
...Player[i] \textbf{returns} z \\
\textbf{every} Player[i] \textbf{returns} w
}
}](img7.png)