cryptobiu / MATRIX

MPC Simulation Framework
MIT License
24 stars 13 forks source link

protocol execution: fix party index #24

Closed lenerd closed 5 years ago

lenerd commented 5 years ago

Introduced in 79610b4d96632c346e4384fcc8de4f47dc375755, this bug resulted in miscalculated party indices starting from -1: https://github.com/cryptobiu/MATRIX/blob/79610b4d96632c346e4384fcc8de4f47dc375755/Execution/fabfile.py#L111

liorko87 commented 5 years ago

It's not mistake. Take a look at this scenario: Let's assume that we have 3 parties that act as clients and one server that coordinate between them, total of 4 different machines. The server needs to be on air when the parties tries to connect., so he will be the first party, i.e. party_id= 0. The clients id are running from 0to 2.
because the server defined as party_id= 0 and the clients are also need to start from 0 the line is run('. ./%s %s %s' % (executable_name[idx], party_id - 1, values_str)) and not run('. ./%s %s %s' % (executable_name[idx], party_id , values_str))

I will add some description to the fabfile at the next commit

lenerd commented 5 years ago

Hi Lior,

the line I referenced above handled the case without a coordinating party.

However, you have fixed the off-by-one in ef6ef8ad34ccce85cc581d86518d5ad0b7cd0a7f here:

Thanks!

lenerd commented 5 years ago

With the changes from ef6ef8ad34ccce85cc581d86518d5ad0b7cd0a7f, the parties.conf file is no longer uploaded to the servers if the (external) protocol is run without coordinating parties. See

and maybe

Edit: See #29.