Full Description

Garbling. The garbling algorithm is described as follows.

  • Let , be the set of input and output wires of , respectively. Given a non-input wire , let denote the two input wires of associated to an or gate. Let denote the input wire of associated to an gate. The garbler maintains three sets , and . The garbler also maintains a initiated as .

  • Choose a secret global 128-bit string uniformly, and set . Let be the label of public bit , where is chosen uniformly at random. Note that will be sent to the evaluator.

  • For , do the following.

    • Choose -bit uniformly at random, and set .
    • Let and insert it to .
  • For any non-input wire , do the following.

    • If the gate associated to is a gate.
      • Let .
      • Compute and .
    • If the gate associated to is an gate.
      • Let ,
      • Compute and .
    • If the gate associated to is an gate.
      • let ,
      • Let , .
      • Compute the first half gate:
      • Let .
      • Let .
      • .
      • Compute the second half gate:
      • Let .
      • Let
      • Let , and insert the garbled gate to .
      • .
  • For , do the following.

    • Compute .
    • Insert into .
  • The garbler outputs .

Input Encoding. Given , the garbler encodes the input as follows.

  • For all , compute
  • Outputs .

Evaluating. The evaluating algorithm is described as follows.

  • The evaluator takes as input the garbled circuit and the encoded inputs .

  • The evaluator obtains the input labels from and initiates .

  • For any non-input wire , do the following.

    • If the gate associated to is a gate.
      • Let .
      • Compute .
    • If the gate associated to is an gate.
      • Let ,
      • Compute .
    • If the gate associated to is an gate.
      • Let ,
      • Let , .
      • Parse as .
      • Compute .
      • .
      • Compute .
      • Let .
  • For , do the following.

    • Let .
    • Outputs , the set of .

Output Decoding. Given and , the evaluator decodes the labels into outputs as follows.

  • For any , compute .
  • Outputs all .