## 2 A One-Time Pad with True Randomness  
Section 2 considers the first building block for secure multiparty computation (SMPC) among two parties using a third dummy party in a procedure inspired by [14]. Although the procedure generally applies to any set of numbers, we consider, in particular, the numbers in \(\mathbb{Z}\) or \(\mathbb{Z}_{p}\), in which \(p\) is an appropriate prime. This decision does not introduce additional limitations as all messages, textual or otherwise, must be transformed into a number (or series of numbers) for encryption purposes. Think of two parties, \(P_{1}\) and \(P_{2}\), who wish to agree on a shared key using multiparty computation that involves the sum of their private inputs \(x_{1}\), \(x_{2}\) in \(\mathbb{Z}_{p}\), but without disclosing them to each other. The procedure needs, of course, a third party, which will be \(P_{3}\), which is used as an auxiliary server that only receives inputs and transmits the resulting sum of the inputs. **Share generation**:  
Each party \(P_{i}\), \(i=1,2\), generates two random shares \(r_{i,1}\) and \(r_{i,2}\) in \(\mathbb{Z}_{p}\) and computes a third share \(r_{i,3}\) as the difference between their private input \(x_{i}\) and the sum of the two random shares, modulo \(p\), as described by the following equations:  
\[(r_{i,1},r_{i,2}) \stackrel{{\$}}{{\leftarrow}} \mathbb{Z}_{p}\times\mathbb{Z}_{p}, \tag{1}\] \[r_{i,3} = x_{i}-(r_{i,1}+r_{i,2})\mod p,\quad i=1,2. \tag{2}\]  
Party \(P_{3}\) generates three random numbers, \(r_{3,j}\stackrel{{\$}}{{\leftarrow}}\mathbb{Z}_{p}\), \(j=1,2,3\). **Standard share distribution** (as in [14]):  
Each party \(P_{i}\) sends two of its three shares to the other parties according to a specific rule to ensure that no one party receives all shares from another party. Quote: Each \(P_{i}\) sends privately \(r_{i,2}\), \(r_{i,3}\) to \(P_{1}\), \(r_{i,1}\), \(r_{i,3}\) to \(P_{2}\), and \(r_{i,1}\), \(r_{i,2}\) to \(P_{3}\). Hence, the distribution pattern is as follows:  
\[ \begin{array}{l}P_{1}:\quad---\\ P_{2}:\quad\boxed{r_{2,2}||r_{2,3}\to P_{1}}\\ P_{3}:\quad\boxed{r_{3,2}||r_{3,3}\to P_{1}}\end{array} \boxed{r_{1,1}||r_{1,3 }\to P_{2}}\boxed{r_{1,1}||r_{1,2}\to P_{3}}\\ \boxed{r_{3,1}||r_{3,3}\to P_{2}}\end{array} \tag{3}\]  
**Modified share distribution**:  
Each \(P_{i}\) sends privately \(r_{i,j}\) to \(P_{j}\), \(i\
eq j\), \(i,j=1,2,3\). Hence, the distribution pattern is as follows:  
\[ \begin{array}{l}P_{1}:\quad---\\ P_{2}:\quad\boxed{r_{2,1}\to P_{1}}\\ P_{3}:\quad\boxed{r_{3,1}\to P_{1}}\end{array} \boxed{r_{2,1}\to P_{2}}\boxed{ r_{1,3}\to P_{3}}\\ \boxed{r_{3,2}\to P_{2}}\end{array}\boxed{r_{2,3}\to P_{3}} \tag{4}\]  
**Partial sum determination**:  
In the standard procedure, each party \(P_{j}\) adds the corresponding shares as \(s_{l}=r_{1,l}+r_{2,l}+r_{3,l}\), \(l\
eq j,j=1,2,3\). In the modified share distribution, each party \(P_{j}\) computes the (single) sum of the shares received according to the following:  
\[s_{j}=r_{1,j}+r_{2,j}+r_{3,j},\quad j=1,2,3. \tag{5}\]  
For instance, \(P_{2}\) is aware of his own generated shares, \(r_{2,1}\), \(r_{2,2}\), and \(r_{2,3}\). Additionally, he has obtained \(r_{1,2}\) from \(P_{1}\) and \(r_{3,2}\) from \(P_{3}\). Therefore, \(P_{2}\) can calculate \(s_{2}\), which is expressed as \(s_{2}=r_{1,2}+r_{2,2}+r_{3,2}\). **Partial sum distribution**:  
In the standard procedure, each party computes and announces (broadcasts) two values. In our proposed modification, \(P_{1}\) sends \(s_{1}\) to \(P_{2}\), \(P_{2}\) sends \(s_{2}\) to \(P_{1}\), and \(P_{3}\) broadcasts \(s_{3}\) to \(P_{1}\) and \(P_{2}\):  
\[ \begin{array}{l}P_{1}:\quad---\\ P_{2}:\quad\boxed{s_{2}\to P_{1}}\\ P_{3}:\quad\boxed{s_{3}\to P_{1}}\end{array} \boxed{r_{2}\to P_{2}}\boxed{ r_{1,1}||r_{1,2}\to P_{3}}\boxed{r_{2,1}||r_{2,2}\to P_{3}}\\ \boxed{r_{3,1}||r_{3,3}\to P_{2}}\end{array} \tag{6}\]  
**Final sum calculation**:  
In the standard procedure, all parties compute the result \(s_{1}+s_{2}+s_{3}\mod p\).