Package viff :: Module hash_broadcast :: Class HashBroadcastMixin
[hide private]
[frames] | no frames]

Class HashBroadcastMixin

source code


A non-consistent broadcast scheme mainly useful for full threshold security.

A value is send using `send_value` and when received a hash is generated and exchanged among the receivers. If a receiver receives a hash which is not equal to the one he generated, then he sends an error signal to the others and they stop the computation. Else he sends an ok signal and the computation continues.

Instance Methods [hide private]
 
_receive_broadcast(self, pc, unique_pc, sender, receivers) source code
 
_send_message(self, pc, sender, receivers, message) source code
 
broadcast(self, senders, receivers, message=None)
Broadcast the messeage from senders to receivers.
source code
 
error_handler(self, ex) source code
 
list_str(self, s) source code
Method Details [hide private]

broadcast(self, senders, receivers, message=None)

source code 

Broadcast the messeage from senders to receivers.

Returns a list of deferreds if the calling player is among the receivers and there are multiple senders. Returns a single element if there is only on sender, or the calling player is among the senders only.

The order of the resulting list is guaranteed to be the same order as the list of senders.

Senders and receivers should be lists containing the id of the senders and receivers, respectively.

Note: You send implicitly to your self.