Division of two ciphertext

Hi,

I am interested in division of two ciphertext. I came across the following link,

As per the info at the link – to be precise commented by @umutsahin – it is not implemented in CONCRETE. I was wondering if there is an implementation in tfhe-rs. As mention at – Types & Operations | TFHE-rs – Div is supported. However, it appears as Div*. I could not see the significance of *, which would be really appreciated.

I would really appreciate any leads on the topic.

Thanks.
Bhavin.

@bhavinmoriya58 I think it was just for the div/rem specification below the table

A bit off topic, but strictly speaking, it’s possible to use divisions in Concrete, see the use of fhe.multivariate(lambda x, y: x // y)(x, y) in the Concrete thread.

Is there any code implementing the division in tfhe-rs?

@bhavinmoriya58

you can look at the code in tfhe-rs/tfhe/src/integer/server_key/radix_parallel/div_mod.rs at 2e1e743bcc8fbadf3fca6f8cb6ef905aebd90a30 · zama-ai/tfhe-rs · GitHub and follow the function calls

@IceTDrinker Using this code if I run 1/4, I will get (0,1) as output. I mean, given Input: numerator=1, denominator=4, we get output: quotient=0 and remainder=1. However, I was expecting 0.25 as an answer. I believe, since tfhe works with integers, tfhe-rs does not have implementation which gives .25 as output. Correct me if I am wrong?

It is because it is an integer division @bhavinmoriya58

same as the rust division and other languages, in python it is the // operator.

example on rust playground

rust std docs

Wikipedia on the topic

1 Like