Open mialuyao opened 2 months ago
The code you have written will generate random values. Suppose x = 1, a = 2, b = 3:
Rank 0 gets random values: (r_x, r_a, r_b) Rank 1 gets random values: (-r_x + 1, -r_a + 2, -r_b + 3)
Rank 0 gets random values: (w_x, w_a, w_b) Rank 1 gets random values: (-w_x + r_x, -w_a + r_a, -w_b + r_b)
This eliminates all of the information from Rank 1, and therefore eliminates all information about x, a, and b (you will get random values)
If you are trying to get the value of (x >= a AND b >= x), the following is most efficient:
result = x_enc.ge(a_enc) * b_enc.ge(x_enc)
There are ways of doing this directly using BinarySharedTensor, but it would be more complex and involve dealing with some internals
Thank you for your response!
The code I provided was just an example. My core question is about performing binary operations on binary shares.
I understand that MPCTensor
is essentially a wrapper for BinarySharedTensor
, but I am encountering unsupported operation ^ on MPCtensor and MPCTensor
when attempting ^
on two binary shares.
How can this issue be resolved and why?
Thank you!
I am attempting to compute the AND operation on two binary shares, but I am getting unexpected results that are not 0 or 1.
Here is my code:
However, the result I got is:
The result is not in the form of 0 or 1 as I expected. Can someone explain why this is happening and how I can fix it?
Thank you for your assistance!