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
def __binop_field(self, other, op):
assert callable(op)
if isinstance(other, int):
other = self.context.field(other)
res = GFElementFuture()
...
Since it always returns a GFElementFuture.
But it should be possible to multiply a GFElementFuture by a Share, which should result in a ShareFuture. This is how beaver multiplication works in mpc.py:test_prog1:
e = (y - b).open()
await d
await e
# This is a random share of x*y
logging.info(f'type(d): {type(d)}') # GFElementFuture
logging.info(f'type(b): {type(b)}') # Share
xy = d*e + d*b + e*a + ab
logging.info(f'type(x): {type(x)}') # Share
logging.info(f'type(y): {type(y)}') # Share
logging.info(f'type(xy): {type(xy)}') # GFElementFuture, but should be Share
x_, y_, xy_ = await x.open(), await y.open(), await xy.open()
The solution would be:
add Share and ShareFuture to the typecheck options for GFElementFuture, and
have the return object for this be ShareFuture if the arg type is Share or ShareFuture
The text was updated successfully, but these errors were encountered:
I think we can actually accomplish this by modifying the type-checking.
If a special built-in method (__add__, for example) returns NotImplemented instead of raising an AssertionError, then it will call __radd__ on the other operand. Thus, we would be able to call code like fut + share and it will call share.__radd__(fut) and we don't have to have duplicate logic to handle this.
This logic for gfelement future is too conservative:
https://github.com/initc3/HoneyBadgerMPC/blob/dev/honeybadgermpc/progs/mixins/dataflow.py#L15
Since it always returns a GFElementFuture.
But it should be possible to multiply a GFElementFuture by a Share, which should result in a ShareFuture. This is how beaver multiplication works in
mpc.py:test_prog1
:The solution would be:
Share
andShareFuture
to the typecheck options for GFElementFuture, andThe text was updated successfully, but these errors were encountered: