I am considering a field $\mathbb{Z}_p=\{0,1,\cdots,p-1\}$, where $p$ is a prime. Suppose I have a secret $x \in \mathbb{Z}_p$ and a random mask $m \in \mathbb{Z}_p$. Prior answers show $y=x*m \mod p$ does not reveal any information about $x$ if $x \neq 0$ and $m \neq 0$. For the secret $x$, I know there are some ways to make it always greater than zero, such as adding a large bias. However, for the mask $m$, it is supposed to be randomly sampled from the field, I am confused about delibrately excludeing $m \neq 0$.
- The masked element $y$ is in a different group $\mathbb{Z}_p /\ \{0\}$ than the original field $\mathbb{Z}_p$. I am wondering whether the computation of $y$ and the field element still holds correctness. For example, for an element $a \in \mathbb{Z}_p$, is $(mx+ma) *m^{-1} \mod p$ equals to $x+a \mod p$. I have this question because $mx+ma \mod p$ may results in $0$ that is not in the group $\mathbb{Z}_p /\ \{0\}$ and is the restoring by multiplying $m^{-1}$ correct? I have tried some concrete numbers and find it seems to hold.
- Excluding $m = 0$ introduces a non-uniform distribution for $y$ over $\mathbb{Z}_p$, since $y = 0$ is impossible. Does this deviation from uniformity security guarantees, particularly in the context of the field operations?
Update: Since the original question may be ambiguous regarding the source of concern, I’ll briefly describe the protocol under consideration.
After masking a value $x \in \mathbb{Z}_p$ with a random mask $m \in \mathbb{Z}_p$, the product $y = x \cdot m \mod p$ is sent to another party. Along with this, two ciphertexts are sent: $\text{Enc}(a \cdot m \mod p)$ and $\text{Enc}(b)$, where $\text{Enc}(\cdot)$ denotes encryption under a homomorphic encryption scheme. The receiving party then computes: $ \text{Enc}(z) = y \cdot \text{Enc}(b) + \text{Enc}(a \cdot m) $. Note that the prime $p$ is also used in the plaintext polynomial ring underlying the homomorphic encryption scheme. The resulting ciphertext $\text{Enc}(z)$ is then returned to me. Upon decryption, I obtain: $ z = y \cdot b + a \cdot m \mod p $. Finally, I compute $z \cdot m^{-1} \mod p$, which yields: $ b \cdot x + a \mod p $. I’m interested in understanding both the correctness and security of this protocol.
P.S.: I know this may seem unnecessary since I could directly compute $b * x + a \mod p$, but please ignore that aspect for now.