RtsPsiManager#

class RtsPsiManager#

Client side of the PSI for federated learning module.

compaction(self: pyhelayers.RtsPsiManager, final_indicator_vector: pyhelayers.CTileTensor) pyhelayers.CTileTensor#

Given the final indicator vector, encrypted under the flHe’s key, outputs a CTileTensor with original shape as the given data DoubleTensor shape, that contains the samples which are in the intersection in the first rows, and where all the other rows are encryptions of 0s.

Parameters:

final_indicator_vector – The final indicator vector

generate_indicator_vector(self: pyhelayers.RtsPsiManager, source_rts_id: int, masked_hash_table: pyhelayers.CTileTensor) pyhelayers.CTileTensor#

The RTS will receive from the aggregator the CTileTensor originated from other RTS to process. It should process it using this method and send the result back to the aggregator.

Parameters:
  • source_rts_id – ID of the RTS that generated the hash table

  • masked_hash_table – The CTileTensor received from the aggregator.

get_uids_mapping(self: pyhelayers.RtsPsiManager) numpy.ndarray[numpy.uint64]#

The first step to be run by the RTS. Insert the UIDs of the client to hash table and encrypt it. The result should be sent to the aggregator. This CTileTensor will then be sent to the other RTS.

get_uninserted_uids(self: pyhelayers.RtsPsiManager) numpy.ndarray[numpy.uint64]#

Returns the list of UIDs that were not inserted to the hash table. A UID might not be inserted in the case where all the mappings that were generated using the Cuckoo hashing hash function, led to collision with some other UID.

get_verbosity(self: pyhelayers.RtsPsiManager) pyhelayers.Verbosity#

Get the Verbosity level.

insert_to_hash(self: pyhelayers.RtsPsiManager) pyhelayers.CTileTensor#

The first step to be run by the RTS. Insert the UIDs of the client to hash table and encrypt it. The result should be sent to the aggregator. This CTileTensor will then be sent to the other RTS.

multiply_indicator_vectors(self: pyhelayers.RtsPsiManager, rtss_ids: numpy.ndarray[numpy.uint8], masked_indicator_vectors: pyhelayers.CTileTensorVector) pyhelayers.CTileTensor#

Given the indicator vectors generated by the other RTSs, encrypted under the flHe’s key, outputs a single indicator vector which is the product of all of them. Notice that the result of this function is not masked, and thus must not be shared with the aggregator, but only passed as an argument to the compaction function.

Parameters:
  • rtss_ids – IDs of the RTSs that generated the indicator vector

  • masked_indicator_vectors – The indicator vectors. The order of the these must match the order of the RTSs IDs.

set_verbosity(self: pyhelayers.RtsPsiManager, verbosity: pyhelayers.Verbosity) None#

Sets the verbosity level

Parameters:

verbosity – Verbosity level