MPC-SoK / frameworks

Sample code and build environments for MPC frameworks
Other
486 stars 111 forks source link

mpyc mult3.py example gives result different from expected when M > 3 #57

Open danxinnoble opened 2 years ago

danxinnoble commented 2 years ago

For instance: root@c609d1fbbcde:~/source# python mult3.py -M 6 2021-11-24 11:51:28,496 Start MPyC runtime v0.7 2021-11-24 11:51:28,830 All 6 parties connected. player 0 input: 4000 expected: 64000000000 result: -740248758255576370955515465 2021-11-24 11:51:28,885 Stop MPyC runtime -- elapsed time: 0:00:00.388515

marsella commented 2 years ago

This library overflows silently, and sometimes has unexpected overflows due to intermediate values in the computation (this is more common with division). I see that 64000000000 is 35 bits, maybe it's overflowing a 32-bit integer?