code: def setup(self, options: typing.Optional[dict] = None):
      if options is None:
          kind = self.kind
          key_size = self.key_length
      else:
          kind = options.get("kind", self.kind)
          key_size = options.get("key_length", self.key_length)
  
      if kind == "paillier":
          if not cfg.safety.phe.paillier.allow:
              raise ValueError("paillier is not allowed in config")
          if key_size < cfg.safety.phe.paillier.minimum_key_size:
              raise ValueError(
                  f"key size {key_size} is too small, minimum is {cfg.safety.phe.paillier.minimum_key_size}"
              )
          from fate.arch.protocol.phe.paillier import evaluator, keygen
          from fate.arch.tensor.phe import PHETensorCipher
  
          sk, pk, coder = keygen(key_size)
          tensor_cipher = PHETensorCipher.from_raw_cipher(
              pk, coder, sk, evaluator
          )
  
          return PHECipher(
              kind,
              key_size,
              pk,
              sk,
              evaluator,
              coder,
              tensor_cipher,
              True,
              True,
              True,
          )
  
      if kind == "ou":
          if not cfg.safety.phe.ou.allow:
              raise ValueError("ou is not allowed in config")
          if key_size < cfg.safety.phe.ou.minimum_key_size:
              raise ValueError(
                  f"key size {key_size} is too small, minimum is {cfg.safety.phe.ou.minimum_key_size}"
              )
          from fate.arch.protocol.phe.ou import evaluator, keygen
          from fate.arch.tensor.phe import PHETensorCipher
  
          sk, pk, coder = keygen(key_size)
          tensor_cipher = PHETensorCipher.from_raw_cipher(
              pk, coder, sk, evaluator
          )
          return PHECipher(
              kind,
              key_size,
              pk,
              sk,
              evaluator,
              coder,
              tensor_cipher,
              False,
              False,
              True,
          )
  
      elif kind == "mock":
          if not cfg.safety.phe.mock.allow:
              raise ValueError("mock is not allowed in config")
          from fate.arch.protocol.phe.mock import evaluator, keygen
          from fate.arch.tensor.phe import PHETensorCipher
  
          sk, pk, coder = keygen(key_size)
          tensor_cipher = PHETensorCipher.from_raw_cipher(
              pk, coder, sk, evaluator
          )
          return PHECipher(
              kind,
              key_size,
              pk,
              sk,
              evaluator,
              coder,
              tensor_cipher,
              True,
              False,
              False,
          )
  
      else:
          raise ValueError(f"Unknown PHE keygen kind: {self.kind}")
  
imports: import logging
  import typing
  from fate.arch.config import cfg
  from ..unify import device
label_desc: Use image node_id 3 for calling the PHECipherBuilder obj's underlying member method code with example usage: obj.setup(options) and returns: PHECipher, PHECipher, PHECipher