secretflow.device.kernels#

secretflow.device.kernels.heu#

Functions:

heu_to_heu(self, heu[, config])

heu_to_pyu(self, pyu[, config])

heu_to_spu(self, spu)

heu_to_same_heu(self, config)

heu_to_other_heu(self, dest_device, config)

add(self, other)

sub(self, other)

mul(self, other)

matmul(self, other)

secretflow.device.kernels.heu.heu_to_heu(self: HEUObject, heu: HEU, config: Optional[HEUMoveConfig] = None)[源代码]#
secretflow.device.kernels.heu.heu_to_pyu(self: HEUObject, pyu: PYU, config: Optional[HEUMoveConfig] = None)[源代码]#
secretflow.device.kernels.heu.heu_to_spu(self: HEUObject, spu: SPU)[源代码]#
secretflow.device.kernels.heu.heu_to_same_heu(self: HEUObject, config: HEUMoveConfig)[源代码]#
secretflow.device.kernels.heu.heu_to_other_heu(self: DeviceObject, dest_device: HEU, config: HEUMoveConfig)[源代码]#
secretflow.device.kernels.heu.add(self: HEUObject, other)[源代码]#
secretflow.device.kernels.heu.sub(self: HEUObject, other)[源代码]#
secretflow.device.kernels.heu.mul(self: HEUObject, other)[源代码]#
secretflow.device.kernels.heu.matmul(self: HEUObject, other)[源代码]#

secretflow.device.kernels.pyu#

Functions:

pyu_to_pyu(self, pyu)

pyu_to_spu(self, spu[, spu_vis])

Transfer pyuobject to the spu.

pyu_to_heu(self, heu[, config])

pyu_to_teeu(self, teeu, allow_funcs)

Transfer a PYUObject to TEEU.

secretflow.device.kernels.pyu.pyu_to_pyu(self: PYUObject, pyu: PYU) PYUObject[源代码]#
secretflow.device.kernels.pyu.pyu_to_spu(self: PYUObject, spu: SPU, spu_vis: str = 'secret') SPUObject[源代码]#

Transfer pyuobject to the spu.

参数:
  • self – the pyuobject to transfer.

  • spu – to this SPU device.

  • spu_vis – optional; SPU object visibility. Value can be: - secret: Secret sharing with protocol spdz-2k, aby3, etc. - public: Public sharing, which means data will be replicated to each node.

返回:

the transferred SPUObject.

secretflow.device.kernels.pyu.pyu_to_heu(self: PYUObject, heu: HEU, config: Optional[HEUMoveConfig] = None)[源代码]#
secretflow.device.kernels.pyu.pyu_to_teeu(self: PYUObject, teeu: TEEU, allow_funcs: Union[Callable, List[Callable]])[源代码]#

Transfer a PYUObject to TEEU.

Transfer a PYUObject to TEEU, the main steps are: 1) Create an authority with the specific function and enclave through

the authority manager. A data key will be generated for next step.

  1. Use the data key to encrypt the data with AES-GCM.

参数:
  • self – the PYUObject instance.

  • teeu – the TEEU.

  • allow_funcs – the function(s) to allow using this PYUObject. Function not in this list can not use this PYUObject.

返回:

A TEEUObject whose underlying data is ciphertext.

secretflow.device.kernels.spu#

Functions:

spu_to_pyu(self, pyu[, config])

spu_to_spu(self, spu)

spu_to_heu(self, heu[, config])

psi_df(device, key, dfs, receiver[, ...])

psi_csv(device, key, input_path, ...[, ...])

psi_join_df(device, key, dfs, receiver, ...)

psi_join_csv(device, key, input_path, ...[, ...])

pir_setup(device, server, input_path, ...[, ...])

pir_query(device, server, config[, protocol])

secretflow.device.kernels.spu.spu_to_pyu(self: SPUObject, pyu: Device, config: Optional[HEUMoveConfig] = None)[源代码]#
secretflow.device.kernels.spu.spu_to_spu(self: SPUObject, spu: SPU)[源代码]#
secretflow.device.kernels.spu.spu_to_heu(self: SPUObject, heu: Device, config: Optional[HEUMoveConfig] = None)[源代码]#
secretflow.device.kernels.spu.psi_df(device: SPU, key: Union[str, List[str], Dict[Device, List[str]]], dfs: List[PYUObject], receiver: str, protocol='KKRT_PSI_2PC', precheck_input=True, sort=True, broadcast_result=True, bucket_size=1048576, curve_type='CURVE_25519', preprocess_path=None, ecdh_secret_key_path=None, dppsi_bob_sub_sampling=0.9, dppsi_epsilon=3) List[PYUObject][源代码]#
secretflow.device.kernels.spu.psi_csv(device: SPU, key: Union[str, List[str], Dict[Device, List[str]]], input_path: Union[str, Dict[Device, str]], output_path: Union[str, Dict[Device, str]], receiver: str, protocol='KKRT_PSI_2PC', precheck_input=True, sort=True, broadcast_result=True, bucket_size=1048576, curve_type='CURVE_25519', preprocess_path: Optional[Union[str, Dict[Device, str]]] = None, ecdh_secret_key_path=None, dppsi_bob_sub_sampling=0.9, dppsi_epsilon=3)[源代码]#
secretflow.device.kernels.spu.psi_join_df(device: SPU, key: Union[str, List[str], Dict[Device, List[str]]], dfs: List[PYUObject], receiver: str, join_party: str, protocol='KKRT_PSI_2PC', precheck_input=True, bucket_size=1048576, curve_type='CURVE_25519') List[PYUObject][源代码]#
secretflow.device.kernels.spu.psi_join_csv(device: SPU, key: Union[str, List[str], Dict[Device, List[str]]], input_path: Union[str, Dict[Device, str]], output_path: Union[str, Dict[Device, str]], receiver: str, join_party: str, protocol='KKRT_PSI_2PC', precheck_input=True, bucket_size=1048576, curve_type='CURVE_25519')[源代码]#
secretflow.device.kernels.spu.pir_setup(device: SPU, server: str, input_path: str, key_columns: Union[str, List[str]], label_columns: Union[str, List[str]], oprf_key_path: str, setup_path: str, num_per_query: int, label_max_len: int, protocol='KEYWORD_PIR_LABELED_PSI')[源代码]#
secretflow.device.kernels.spu.pir_query(device: SPU, server: str, config: Dict[Device, Dict], protocol='KEYWORD_PIR_LABELED_PSI')[源代码]#

secretflow.device.kernels.teeu#

Functions:

teeu_to_pyu(self, pyu)

secretflow.device.kernels.teeu.teeu_to_pyu(self: TEEUObject, pyu: PYU) PYUObject[源代码]#