Skip to main content

Free XOR

The Free-XOR optimization significantly improves the efficiency of garbled circuit. The garbler and evaluator could handle XOR\xor gates for free! The method is given in KS08.

  • The garbler chooses a global uniformly random string Δ\Delta with LSB(Δ)=1\lsb(\Delta) = 1.

  • For any XOR\xor gate with input wires a,ba,b and output wire cc, the garbler chooses uniformly random labels XaX_a and XbX_b.

  • Let XaX_a and XaΔX_a\oplus \Delta denote the 0 label and 1 label for input wire aa, respectively. Similarly for wire bb.

  • Let XaXbX_a\oplus X_b and XaXbΔX_a\oplus X_b\oplus \Delta denote the 0 label and 1 label for input wire cc, respectively.

  • The garbler does not need to send garbled gate for each XOR\xor gate. The evaluator locally XOR\xors the input labels of XOR\xor gate to gets the output label. This is correct because given a XOR\xor gate, the label table could be as follows.

aabbcc
XaX_aXbX_bXaXbX_a\oplus X_b
XaX_aXbΔX_b\oplus \DeltaXaXbΔX_a\oplus X_b\oplus \Delta
XaΔX_a\oplus \DeltaXbX_bXaXbΔX_a\oplus X_b\oplus \Delta
XaΔX_a\oplus \DeltaXbΔX_b\oplus \DeltaXaXbX_a\oplus X_b

Here are some remarks of the Free-XOR optimization.

  • Free XOR is compatible with the point-and-permute optimization because LSB(Δ)=1\lsb(\Delta) = 1.

  • The garbler should keep Δ\Delta private all the time for security reasons.

  • Garbling AND\and gate is the same as before except that all the labels are of the form (X,XΔ)(X,X\oplus \Delta) for uniformly random XX.