A 2-party computation in SecretFlow where submitted functions are different.
Requires Python 3.8. Virtualenv recommended.
pip install -r requirements.lock -r requirements-dev.lock
Spin up 2 Ray instances, both locally, on port 32400 and 32401.
./start_ray.sh
In two separate terminals, run alice.py
and bob.py
:
python alice.py
python bob.py
Both should eventually print out:
[ 0. -0.5 -1. -1.5 -2. -2.5 -3. -3.5 -4. -4.5]
However, the functions submitted are different:
In alice.py
:
def multiply(x, y):
return jnp.negative(jnp.multiply(x, y))
In bob.py
:
def multiply(x, y):
return jnp.multiply(x, y)