-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about PutSharedIN/OUTGate #167
Comments
Can you explain what this line is supposed to do? |
Because PutSharedINGate return "gate id" , and what I want is an 'share' object |
There is a version of |
Hi @Moriarty002 I think you just slightly misunderstood the functions. Following is an example for uint32_t a_int = 3;
uint32_t b_int = 4;
share* s_a;
share* s_b;
share* s_c;
// Input
if(role == SERVER){
s_a = bc->PutINGate(a_int, bitlen, SERVER);
s_b = bc->PutDummyINGate(bitlen);
}
else if(role == CLIENT){
s_a = bc->PutDummyINGate(bitlen);
s_b = bc->PutINGate(b_int, bitlen, CLIENT);
}
s_c = bc->PutADDGate(s_a, s_b);
share* out = bc->PutSharedOUTGate(s_c);
// Execute and get shared output
party->ExecCircuit();
uint32_t c_int_shared = out->get_clear_value<uint32_t>();
std::cout << (role == SERVER?"server: ":"client: ") << c_int_shared << std::endl; // here output the shared value.
party->Reset(); // Reset after getting the output value
// Put shared value as input
out = bc->PutSharedINGate(c_int_shared, bitlen);
out = bc->PutOUTGate(out, ALL);
// Execute agagin and get the reconstructed result
party->ExecCircuit();
uint32_t c_int = out->get_clear_value<uint32_t>();
std::cout << "Result: " << c_int << std::endl; // here output the reconstructed value 7, the result of 3+4.
party->Reset(); |
Thanks very much . |
Hello,sorry to bother you @dd23 @aben20807 , would you please take a look at my code, it does not output as expected.
Hope for your guidance. |
solved |
How to use these two function
I try to use them in my way like below
I expect that the
out[1]
is same as server input , but the output of out[1] is 0I want to know how to use PutSharedIN/OUT correctly
The text was updated successfully, but these errors were encountered: