nvflare.app_opt.he.model_decryptor module

class HEModelDecryptor(tenseal_context_file='client_context.tenseal', data_kinds: [<class 'str'>] = None)[source]

Bases: DXOFilter

Filter to decrypt Shareable object using homomorphic encryption (HE) with TenSEAL https://github.com/OpenMined/TenSEAL.

Parameters:
  • tenseal_context_file – tenseal context files containing decryption keys and parameters

  • data_kinds – kinds of DXOs to filter

decryption(params: dict, encrypted_layers: dict, fl_ctx: FLContext)[source]
handle_event(event_type: str, fl_ctx: FLContext)[source]

Handles events.

Parameters:
  • event_type (str) – event type fired by workflow.

  • fl_ctx (FLContext) – FLContext information.

process_dxo(dxo: DXO, shareable: Shareable, fl_ctx: FLContext) None | DXO[source]

Filter process apply to the Shareable object.

Parameters:
  • dxo – Data Exchange Object

  • shareable – shareable

  • fl_ctx – FLContext

Returns: DXO object with decrypted weights