fhe-toolkit-linux icon indicating copy to clipboard operation
fhe-toolkit-linux copied to clipboard

DOC SPRINT - CKKS EXAMPLE - Can anyone give me an example about division of ciphertext with CKKS?

Open chengbao-0 opened this issue 5 years ago • 6 comments

Feature description Can anyone give me an example about division of ciphertext with CKKS?

I have no idea how to realize it. I tried to use the inverse of multiplication, but I didn't succeed.

Thanks for your help.

chengbao-0 avatar Oct 24 '20 02:10 chengbao-0

Hi chengbao-0, division between two ciphertexts is not trivial and would incur significant costs to approximate that division.

If you know the divisor, you can perform division by encoding 1/divisor as CKKS plaintext before performing a multByConstant on the ciphertext. Of course, this would leak the divisor.

odellerh avatar Nov 03 '20 17:11 odellerh

Hi chengbao-0, division between two ciphertexts is not trivial and would incur significant costs to approximate that division.

If you know the divisor, you can perform division by encoding 1/divisor as CKKS plaintext before performing a multByConstant on the ciphertext. Of course, this would leak the divisor.

chengbao-0 avatar Nov 03 '20 23:11 chengbao-0

I think I understand what you mean. Thank you very much for your help although it's not the answer I want.

chengbao-0 avatar Nov 03 '20 23:11 chengbao-0

I am updating this title to help plan some sprints to provide better docs and examples

dowem avatar Dec 09 '20 13:12 dowem

Hi Dov, I was hoping you or Udi could provide an example we could use to show how we intend for people to do CKKS division. We might even have an example already somewhere to show this. If there is not one in the examples from the most recent PR we merged, could we get one sometime this week? The question comes up a lot and this seems like a place where convenience API and a good, extremely small example, would help a lot.

dowem avatar Jan 19 '21 22:01 dowem

Unfortunately AFAIK there's no "extremely small example" -- as mentioned above, division by ciphertext is not available in the CKKS scheme. If there's a limit range of known possible ciphertexts, then one could approximate division using a polynomial, and the evaluated the polynomial using normal multiplication and addition operations. We don't have a ready-made example for that. I also looked at the new HElib 2.0 CKKS tutorial and it doesn't include division.

dubek avatar Jan 20 '21 13:01 dubek