You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, sorry for disturbing you.
I have observed that shift operations can be conducted on secure integers successfully on bit-representation. However, it will turn a negative signed integer into an unsigned one.
Here is an example.
Integer a(32, -44, ALICE);
cout<< "a: "<< a.reveal<int32_t>()<<endl;
a = (a >> 2);
cout<< "a: "<< a.reveal<int32_t>()<<endl;
The output is:
a: -44
a: 1073741813
From the view of bit representation, the 11111111 11111111 11111111 11010100 is shifted by 2 bits to 11111111 11111111 11111111 11110101 successfully. However, it is now converted to an unsigned form.
In comparison, if the operation is conducted on a public variable
int a = -44;
cout<< "a: "<< a<<endl;
a = a >> 2;
cout<< "a: "<< a<<endl;
The output is:
a: -44
a: -11
I am curious whether this is caused by my misuse of shift or if I did not define the type of variable correctly. Or maybe, this behavior is special in the MPC scenario so I should avoid using it. May you help me by explaining this?
The text was updated successfully, but these errors were encountered:
Hello, sorry for disturbing you.
I have observed that shift operations can be conducted on secure integers successfully on bit-representation. However, it will turn a negative signed integer into an unsigned one.
Here is an example.
The output is:
From the view of bit representation, the 11111111 11111111 11111111 11010100 is shifted by 2 bits to 11111111 11111111 11111111 11110101 successfully. However, it is now converted to an unsigned form.
In comparison, if the operation is conducted on a public variable
The output is:
I am curious whether this is caused by my misuse of shift or if I did not define the type of variable correctly. Or maybe, this behavior is special in the MPC scenario so I should avoid using it. May you help me by explaining this?
The text was updated successfully, but these errors were encountered: