|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSFE.BOAL.Formatter
public class Formatter
Formatter The format file describes the I/O with Alice and Bob in the following format:
Input line:
Alice/Bob input type "prompt-string" [ line-num1 .. line-numk ]
This line has the following interpretation: First, it designated this as Alice or Bob's input. The 'type' specifies the type of input, e.g., integer. The input will be provided by prompting Alice using "prompt-string". The input value is internally translated into k bits, LSB to MSB. These bits are given as input bits to gates in the designated lines.
Output line:
Alice/Bob output type "output-prefix" [ line-num1 .. line-numk ]
This line has the following interpretation: First, it designated this as Alice or Bob's output. The 'type' specifies the type of output, e.g., integer. The output will be gathered from k output gates, LSB to MSB, in the designated output gate lines. These output bits are translated into a value of the designated type, and printed with the designated "output-prefix"
Example file is:
Alice input integer "Enter # employees (up to 3): " [ 1 2 ] Bob input integer "Enter # employees (up to 3): " [ 3 4 ] Alice output integer "Total # employees: " [ 100 101 102 ] Bob output integer "Total # employees: " [ 100 101 102 ]
This indicates that Alice should be prompted for an integer no greater than 3, which appears as input wires 1 and 2. Similarly, Bob should be prompted for his integer value for input wires 3 and 4. The output for Alice is an integer built off of output wires 100,101,102; likewise is Bob's output.
Constructor Summary | |
---|---|
Formatter(java.io.StreamTokenizer st)
|
Method Summary | |
---|---|
byte[] |
fextractInpPayload(Circuit c,
int total_size,
boolean alice_inputs)
Extract input payload from an encrypted circuit (for the purpose of communicating it in minimal overhead). |
byte[] |
fextractOutPayload(Circuit c,
int total_size,
boolean alice_inputs)
Extract output payload from an encrypted circuit (for the purpose of communicating it in minimal overhead). |
void |
finjectInpPayload(Circuit c,
byte[] info,
boolean alice_inputs)
Inject input payload into a circuit. |
void |
finjectOutPayload(Circuit c,
byte[] info,
boolean alice_outputs)
Inject output payload into a circuit. |
void |
getAliceInput(Circuit c,
java.io.BufferedReader br)
|
void |
getAliceOutput(Circuit c)
|
void |
getBobInput(Circuit c,
java.io.BufferedReader br)
|
void |
getBobOutput(Circuit c)
|
void |
getInput(Circuit c,
boolean is_alice,
java.io.BufferedReader br)
This routine prompts for Alice or Bob inputs, and sets the corresponding wires binary values. |
void |
getOutput(Circuit c,
boolean is_alice)
This routine collects all output results from the circuit for either Alice or Bob, and prints them out (the circuit must be already evaluated). |
void |
markIO(Circuit c,
int[] tsize)
This routine marks all the input/output gates of a circuit as belonging to either Alice or Bob. |
void |
parse()
The parse() method is the parser of the formatter input file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Formatter(java.io.StreamTokenizer st)
Method Detail |
---|
public void markIO(Circuit c, int[] tsize)
c
- a gate-level circuitpublic void getBobInput(Circuit c, java.io.BufferedReader br)
public void getAliceInput(Circuit c, java.io.BufferedReader br)
public void getInput(Circuit c, boolean is_alice, java.io.BufferedReader br)
c
- a gate-level circuitis_alice
- indicates whether this input is for Alice or Bobpublic void getBobOutput(Circuit c)
public void getAliceOutput(Circuit c)
public void getOutput(Circuit c, boolean is_alice)
c
- a gate-level circuitis_alice
- indicates whether this output is for Alice or Bobpublic byte[] fextractInpPayload(Circuit c, int total_size, boolean alice_inputs)
c
- a gate-level circuittotal_size
- total size of the circuit's payload in bytes.alice_inputs
- true for alice, false for bob
public void finjectInpPayload(Circuit c, byte[] info, boolean alice_inputs)
c
- a gate-level circuitinfo
- byte array with data to injectalice_inputs
- true for alice, false for bobpublic byte[] fextractOutPayload(Circuit c, int total_size, boolean alice_inputs)
c
- a gate-level circuittotal_size
- total size of the circuit's payload in bytes.alice_inputs
- true for alice, false for bob
public void finjectOutPayload(Circuit c, byte[] info, boolean alice_outputs)
c
- a gate-level circuitinfo
- byte array with data to injectalice_outputs
- true for alice, false for bobpublic void parse() throws FormatterError
-
- FormatterError.
FormatterError
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |