0
$\begingroup$

The multiplication of 2 ciphertexts generated using Paillier encryption will result in encryption of sum of corresponding plaintexts. I need to do a linear combination operation of N integers in Paillier encrypted domain. Then after multiplying every 2 ciphertexts, do I have to take mod with respect to n^2. OR Is it enough to take mod after multiplying all the N ciphertexts?

Will both give the same result or not?

$\endgroup$

1 Answer 1

4
$\begingroup$

Yes, both will give the same result. However, taking mod after each multiplication is far more efficient: if you do not take modulos during intermediate multiplications, the size of the strings you are multiplying keeps increasing, and so does the time it takes to multiply new strings, at a very fast rate (if you multiply $n$ ciphertexts over the integers before taking the mod, you'll blow up their size by about $n$). This would be a huge unnecessary waste of computation, so you'd better take the modulo after each multiplication.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.