# Design a simplified version of the protocol for secure addition

To learn secure multiparty communication, I want to design a simplified protocol for secure addition, where instead of receiving two (random) numbers in $Z_p$, a player only receives a single (random) number in $Z_p$.

The objective of secure addition is to compute the function $f(x_1, \ldots, x_n) = \sum_{i=1}^{n} x_i \bmod p$

My attempt:

Suppose there are $n$ players. Then for player $P_j$, I set $r_{j,n} = x_j - \sum_{i=1}^{n-1} r_{j,i} \bmod p$ and give $r_{j,i}$ to player $P_i$. Here $r_{j,i}$ is randomly chosen, so that $r_{j,n}$ is randomly distributed as well.

Now, to compute $x_j$ each player $P_i$ must reveal $r_{j,i}$.

Then to compute $f(x_1, \ldots, x_n) = \sum_{i=1}^{n} x_i \bmod p$ each player $P_i$ reveals all shares $r_{j,i}$ for $j=1,\ldots,n$ and they compute:

$$\sum_{i}\sum_{j} r_{j,i} = \sum_ix_i \bmod p$$

I don't think my approach is right, since in the original protocol an intermediate step of computing "intermediary" shares is performed.

Also, how many players may go toghether before the protocol is broken?

http://cs.au.dk/~jbn/cdn/Introduction.pdf