ABY icon indicating copy to clipboard operation
ABY copied to clipboard

is the Euclidean Distance result right?

Open L-coder148 opened this issue 5 years ago • 5 comments

Hello,it seems that the circuit result is not equal to verification when testing the Euclidean Distance using YAO sharing, is that right? but the circuit result is equal to verification when testing it using Bool sharing. a aa

L-coder148 avatar Jan 14 '21 15:01 L-coder148

I got exactly the same problem with you. I try ARITH and YAO sharing , the result is wrong, but when I tryed BOOL sharing , the result is right. Did you solve your problem? Do you know why? Thank you very much!!

suiguangye avatar Oct 25 '21 08:10 suiguangye

I do not solve the problem,Is it convenient for you to contact me on wechat?my wechat ID is f_freely.

L-coder148 avatar Nov 12 '21 02:11 L-coder148

You can see the issuehttps://github.com/encryptogroup/ABY/issues/172, I think the author's answer refers to change the seed of the srand(time(NULL)) from random into a fixed value. such as follows, then the YAO sharing and the BOOl sharing are all right, the author do not test the Euclidean Distance using ARITH sharing.

//srand(time(NULL));
srand(1);

L-coder148 avatar Nov 12 '21 02:11 L-coder148

You could run both roles at the same time like so: ./euclidean_distance_test -r 1 & (./euclidean_distance_test -r 0 2>&1 > /dev/null)

Cabbache avatar Dec 19 '21 16:12 Cabbache

You can see the issuehttps://github.com/encryptogroup/ABY/issues/172, I think the author's answer refers to change the seed of the srand(time(NULL)) from random into a fixed value. such as follows, then the YAO sharing and the BOOl sharing are all right, the author do not test the Euclidean Distance using ARITH sharing.

//srand(time(NULL));
srand(1);

The provided link to the issue is incorrect, this is the correct one

Floating point is not supported in arithmetic (ARITH) sharing by ABY.

There is an instability of the floating point unit, that is mentioned in this paper and you may have bumped into such issues. Quoting from when I read the paper, ABY doesn't conform to IEEE754 standard for floating point while the library you are using to compare the results is highly likely that is conforms to the standard, so you may bump on such an issue.

tur11ng avatar Sep 01 '22 16:09 tur11ng