Skip to content
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

SecFlt's output bug #83

Closed
ZhangHaoTian007 opened this issue Jan 22, 2024 · 4 comments
Closed

SecFlt's output bug #83

ZhangHaoTian007 opened this issue Jan 22, 2024 · 4 comments

Comments

@ZhangHaoTian007
Copy link

In the output method of runtime.py, the output of SecFlt uses the SecureFloat._output method. However, the SecureFloat._output method recursively calls the output method in runtime.py. This can lead to issues where, if the current node is not in the receivers, x_s and x_e become None, resulting in assertion errors and errors in the return values in the SecureFloat._output method.

I hope to find a solution for this issue. If my understanding is incorrect, please let me know.

@lschoe
Copy link
Owner

lschoe commented Jan 22, 2024

There should be no problem here. The calls to the _output() method in the _output() method of SecureFloat are for the significand and the exponent, which are a SecureFixedPoint and a SecureInteger, respectively.

@ZhangHaoTian007
Copy link
Author

There should be no problem here. The calls to the _output() method in the _output() method of SecureFloat are for the significand and the exponent, which are a SecureFixedPoint and a SecureInteger, respectively.

But if the node performing the output is not in the set of receivers, then the _output method inside it, which calls the output method in runtime.py to retrieve the significand and exponent, will return None. As a result, the assertions and return values cannot handle None.

I noticed that while mpyc provides senders and receivers parameters in both input and output, there doesn't seem to be a demo for scenarios where each party has different inputs and outputs.

@lschoe
Copy link
Owner

lschoe commented Jan 23, 2024

Yes, now I see. Good catch, thx! I've fixed the SecureFloat._output() method to handle this case. It gets a bit involved because we want to hide from the parties who are not receivers when the significand s happens to be 0 . If the significand s is 0, we set the exponent e to 0 as well, to prevent information leaking from e.

@lschoe
Copy link
Owner

lschoe commented Jan 23, 2024

I noticed that while mpyc provides senders and receivers parameters in both input and output, there doesn't seem to be a demo for scenarios where each party has different inputs and outputs.

Did you see the Oblivious Transfer demo mpyc/demos/ot.py? That demo has private inputs and private outputs for the parties in the OT protocol.

@lschoe lschoe closed this as completed Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants