class_docstr: hardcoded public parameter
  log2(__prime) > 128
  
  __generator is a primitive root of __prime
docstr: choice:
      false: pick message0
      true: pick message1
code: def receive(self, choices: List[bool]):
      """
      choice:
          false: pick message0
          true: pick message1
      """
  
      betas = []
      masks_for_choices = []
      for _i in range(len(choices)):
          # pick a random element from Z_p
          beta = random.randint(0, self.__prime - 1)
          mask_for_choice = pow(self.__generator, beta, self.__prime)
          betas.append(beta)
          masks_for_choices.append(mask_for_choice)
  
      masks_for_message1s = []
      for i in range(len(choices)):
          # recv mask_for_message1
          mask_for_message1 = comm.get().recv_obj(self.partner_rank)
          masks_for_message1s.append(mask_for_message1)
          if choices[i]:
              masks_for_choices[i] = (
                  masks_for_choices[i] * mask_for_message1
              ) % self.__prime
  
      for i in range(len(choices)):
          # send mask_for_choice
          comm.get().send_obj(masks_for_choices[i], self.partner_rank)
  
      keys = []
      for i in range(len(choices)):
          # compute the hash when waiting for response
          key = sha256(
              str(
                  pow(masks_for_message1s[i], betas[i], self.__prime)
              ).encode("utf-8")
          ).hexdigest()
          keys.append(key)
  
      rst = []
  
      for i in range(len(choices)):
          # recv message0, message1
          message0_enc = comm.get().recv_obj(self.partner_rank)
          message1_enc = comm.get().recv_obj(self.partner_rank)
  
          if choices[i]:
              rst.append(self.string_xor(keys[i], message1_enc))
          else:
              rst.append(self.string_xor(keys[i], message0_enc))
      return rst
  
file_path: FATE/python/fate/arch/protocol/mpc/primitives/ot/baseOT.py
imports: import random
  from hashlib import sha256
  from typing import List
  from ...None import communicator
label_desc: Use image node_id 4 for calling the BaseOT obj's underlying member method code with example usage: obj.receive(choices) and returns: rst