n1analytics / javallier

A Java library for Paillier partially homomorphic encryption.
Other
79 stars 22 forks source link

Optimise subtraction operation #9

Closed mpnd closed 7 years ago

mpnd commented 8 years ago

At the moment, a - b is computed by adding a and the additive inverse of b. Is there a way to optimise the calculation (i.e., without computing the additive inverse of b)?

wilko77 commented 8 years ago

Not in the encrypted space. Paillier only supports addition. In the unencrypted space there certainly are ways without computing the additive inverse, however, the computation of the additive inverse in the unencrypted space is very cheap. Is there a performance issue?