(self, encrypted_const, grad_a_overlap, epoch_idx, local_round=-1)
return const, grad_a_overlap
add random mask to encrypted inter-result, get decrypted data from host add subtract random mask
add random mask to encrypted inter-result, get decrypted data from host add subtract random mask
add random mask to encrypted inter - result get decrypted data from host add subtract random mask
def decrypt_inter_result(self, encrypted_const, grad_a_overlap, epoch_idx, local_round=-1):

        """
        add random mask to encrypted inter-result, get decrypted data from host add subtract random mask
        """

        rand_0 = self.rng_generator.generate_random_number(encrypted_const.shape)
        encrypted_const = encrypted_const + rand_0
        rand_1 = PaillierTensor(self.rng_generator.generate_random_number(grad_a_overlap.shape), partitions=self.partitions)
        grad_a_overlap = grad_a_overlap + rand_1

        self.transfer_variable.guest_side_const.remote(encrypted_const, suffix=(epoch_idx,
                                                                                local_round,))
        self.transfer_variable.guest_side_gradients.remote(grad_a_overlap.get_obj(), suffix=(epoch_idx,
                                                                                             local_round,))
        const = self.transfer_variable.decrypted_guest_const.get(suffix=(epoch_idx, local_round, ), idx=0)
        grad = self.transfer_variable.decrypted_guest_gradients.get(suffix=(epoch_idx, local_round, ), idx=0)
        const = const - rand_0
        grad_a_overlap = PaillierTensor(grad, partitions=self.partitions) - rand_1

        return const, grad_a_overlap
def decrypt_inter_result ( self , encrypted_const , grad_a_overlap , epoch_idx , local_round = - 1 ) : rand_0 = self . rng_generator . generate_random_number ( encrypted_const . shape ) encrypted_const = encrypted_const + rand_0 rand_1 = PaillierTensor ( self . rng_generator . generate_random_number ( grad_a_overlap . shape ) , partitions = self . partitions ) grad_a_overlap = grad_a_overlap + rand_1 self . transfer_variable . guest_side_const . remote ( encrypted_const , suffix = ( epoch_idx , local_round , ) ) self . transfer_variable . guest_side_gradients . remote ( grad_a_overlap . get_obj ( ) , suffix = ( epoch_idx , local_round , ) ) const = self . transfer_variable . decrypted_guest_const . get ( suffix = ( epoch_idx , local_round , ) , idx = 0 ) grad = self . transfer_variable . decrypted_guest_gradients . get ( suffix = ( epoch_idx , local_round , ) , idx = 0 ) const = const - rand_0 grad_a_overlap = PaillierTensor ( grad , partitions = self . partitions ) - rand_1 return const , grad_a_overlap