# Multi Party Computation

Suppose that value of $X, Y$ are shared (using random value) by Alice and Bob.
Alice and Bob compute “secure ADD” independently, and get the shares of the $Z$.
The value of $Z = X + Y$ is shared after the “secure ADD” protocol.

\begin{align} & & \mbox{ Alice } & &\mbox{ Bob } & & \mbox{ Constraint/Result} \\ \mbox{Input } & & X^A, Y^A & & X^B, Y^B & & X^A+X^B = X, Y^A+Y^B = Y\\ \mbox{secure ADD} && Z^A=X^A+Y^A && Z^B=X^B+Y^B && Z^A+Z^B=A+B\\ \end{align}

### MULT

Suppose that value of $X, Y$ are shared (using random value) by Alice and Bob.

#### Preprocessing

\begin{align} && \mbox{ Alice } &&\mbox{ Bob } && \mbox{ Constraint} \\ \mbox{create} && && && \Delta_X \Delta_Y=\Delta_Z (\Delta_X, \Delta_Y \mbox{random})\\ \mbox{store } && \Delta_X^A && \Delta_X^B && \Delta_X^A+\Delta_X^B = \Delta_X \\ \mbox{store } && \Delta_Y^A && \Delta_Y^B && \Delta_Y^A+\Delta_Y^B = \Delta_Y \\ \mbox{store } && \Delta_Z^A && \Delta_Z^B && \Delta_Z^A+\Delta_Z^B = \Delta_Z \\ \end{align}

#### Secure MULT

\begin{align}
\mbox{Input } && X^A, Y^A && X^B, Y^B && X^A+X^B = X, Y^A+Y^B = Y\\
\mbox{Exchange} && X^A-\Delta_X^A && X^B-\Delta_X^B && \\
\mbox{Exchange} && Y^A-\Delta_Y^A && Y^B-\Delta_Y^B && \\
\mbox{Reconstruct} && X-\Delta_X && X-\Delta_X && X-\Delta_X= (X^A-\Delta_X^A)+(X^B-\Delta_X^B)\\
\mbox{Reconstruct} && Y-\Delta_Y && Y-\Delta_Y && Y-\Delta_Y= (Y^A-\Delta_Y^A)+(Y^B-\Delta_Y^B)\\
\mbox{Output } & & Z^A & & Z^B & & Z^A+Z^B=Z \\
\end{align}
\]
The “secure MULT” calculation is:
$Z_A = (x-\Delta_X)(Y-\Delta_Y) + (X-\Delta_X)\Delta_Y^A + (Y-\Delta_Y)\Delta_X^A + \Delta_Z^A \\ Z_B = (X-\Delta_X)\Delta_Y^B + (Y-\Delta_Y)\Delta_X^B + \Delta_Z^B$