SFE.PF
Class UCsel

java.lang.Object
  extended by SFE.BOAL.Circuit
      extended by SFE.PF.UC
          extended by SFE.PF.UCsel
All Implemented Interfaces:
java.io.Serializable

public class UCsel
extends UC

Universal Circuit based on selection blocks.

sizeof(UCsel) = k^2 + k ( 2 u + v - 2 ) - v As this UC construction grows quadratically in k it is only useful for k < 1000 ! However it is good for demonstration purposes because of very simple construction. For the i-th gate (i=1..k) select for each of the two gate inputs the corresponding input value with a selection block that selects from all inputs and the outputs of previous k g < i. For each output select the corresponding of the k outputs of all k with a selection block.

Author:
Thomas Schneider
See Also:
Serialized Form

Field Summary
 
Fields inherited from class SFE.PF.UC
Ggates, Xgates, Ygates
 
Constructor Summary
UCsel()
           
 
Method Summary
 int countGates()
          Count number of gates of UC.
 int estimateGates(int ins, int outs, int k)
          Estimate number of gates of UC.
 Gate[] extractCircuit(Gate[] outputs)
          Extract circuit representation of UC.
 void generate(int u, int v, int k)
          Generate UC for circuit of given shape.
 void program(int[] ins, int[] outs, SFE.PF.ParseGate[] parsegates)
          Program UC with given circuit.
 
Methods inherited from class SFE.PF.UC
generateEncCircuit, generateUC, translateIO
 
Methods inherited from class SFE.BOAL.Circuit
addGate, cextractEncPayload, cextractSecPayload, cinjectEncPayload, cinjectSecPayload, cmeasureEncPayload, cmeasureSecPayload, evalCircuit, evalGarbledCircuit, getGate, isCorrect, printCircuit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UCsel

public UCsel()
Method Detail

countGates

public int countGates()
Description copied from class: UC
Count number of gates of UC.

Specified by:
countGates in class UC
Returns:
#gates of UC

estimateGates

public int estimateGates(int ins,
                         int outs,
                         int k)
Description copied from class: UC
Estimate number of gates of UC.

Specified by:
estimateGates in class UC
Parameters:
ins - #inputs
outs - #outputs
k - #gates of circuit
Returns:
estimated #gates of UC

extractCircuit

public Gate[] extractCircuit(Gate[] outputs)
Description copied from class: UC
Extract circuit representation of UC.

Specified by:
extractCircuit in class UC
Returns:
output gates

generate

public void generate(int u,
                     int v,
                     int k)
Description copied from class: UC
Generate UC for circuit of given shape.

Specified by:
generate in class UC
Parameters:
u - #inputs
v - #outputs
k - #gates

program

public void program(int[] ins,
                    int[] outs,
                    SFE.PF.ParseGate[] parsegates)
Description copied from class: UC
Program UC with given circuit.

Specified by:
program in class UC
Parameters:
ins - inputs
outs - outputs
parsegates - gates of circuit