|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSFE.BOAL.Gate
public class Gate
This class holds information on a single gate
Field Summary | |
---|---|
int |
gate_index
|
static int |
INP_GATE
|
static int |
NBYTESG
|
static int |
REG_GATE
|
Constructor Summary | |
---|---|
Gate(int g_idx,
int n_ins,
int type,
boolean out_gate)
Constructor for class Gate |
Method Summary | |
---|---|
void |
evalGarbledGate(boolean alice_interpret,
boolean bob_interpret)
Evaluate this garbled gate and place result in member garbled_value. |
void |
evalGate()
Evaluate this gate and place result in member 'value'. |
void |
generateEncGate()
Fill in all encrypted values and perms of a gate |
byte[] |
generateEncOutput(int index,
byte[] enc_key)
Return an encrypted value corresponding to this gate for a given index into this gate's truth table. |
byte |
generateEncPerm(int index,
byte enc_key)
Return an encrypted permutation corresponding to this gate for a given index into this gate's truth table. |
byte[] |
genKey(int index,
int permuted_index)
Return an enc/dec mask corresponding to this gate for a given index into this gate's truth table If index is negative then the enc/dec mask is calculated based on this gate's evaluated garbled inputs. |
int |
genPermIndex(int index)
Return a premutated index corresponding to this gate for a given index into this gate's truth table. |
byte[] |
getCode(int bit)
Provide a garbeling code for the designated binary value. |
byte[] |
getGarbledValue()
Return garbled value of this gate (after it was evaluated) |
byte[] |
getPackedCode(int bit)
Provide a garbeling code for the designated binary value of code0/code1 concatenated with garbled perm (for the purpose of transferring both in a single OT) |
int |
getValue()
Return the value of this gate (after it was evaluated) |
byte[] |
gextractEncPayload()
Extract encrypted payload from an encrypted gate. |
byte[] |
gextractInpPayload()
Extract input payload from an encrypted gate. |
byte[] |
gextractOutPayload()
Extract output payload from an encrypted gate. |
byte[] |
gextractSecPayload()
Extract secret payload from an encrypted gate. |
int |
ginjectEncPayload(byte[] info,
int start)
Inject encrypted payload into a gate. |
int |
ginjectInpPayload(byte[] info,
int start)
Inject input payload into a gate. |
int |
ginjectOutPayload(byte[] info,
int start)
Inject output payload into a gate. |
int |
ginjectSecPayload(byte[] info,
int start)
Inject secret payload into a gate. |
int |
gmeasureEncPayload()
Measure size of encrypted payload in an encrypted gate |
int |
gmeasureInpPayload()
Measure size of input payload in an encrypted gate |
int |
gmeasureOutPayload()
Measure size of output payload in an encrypted gate |
int |
gmeasureSecPayload()
Measure size of secret payload in an encrypted gate |
int |
interpretCode()
Interpret a garbled code back to a bit (only for output gates) Note - different treatment for Alice and Bob outputs: evaluation for Alice output against a hash of the garbled value, evaluation for Bob output against the garbled value itself. |
boolean |
isAliceInput()
|
boolean |
isAliceOutput()
|
boolean |
isBobInput()
|
boolean |
isBobOutput()
|
boolean |
isCorrect()
|
boolean |
isInput()
|
boolean |
isOutput()
|
void |
markAliceBob(boolean alice)
Mark an input gate as being Alice's or Bob's |
void |
printGate()
Print a gate (for debugging only). |
void |
setGarbledValue(byte[] gdataCode)
Set the garbled value of this gate and interpret it (in practice - only for Bob output gates). |
void |
setInput(int ind,
Gate in_gate)
Record the specified input gate number at the designated input index. |
void |
setOutput(boolean out_gate)
|
void |
setOutput(int ind,
boolean val)
Record the specified output value at the designated input index. |
void |
setPackedCode(byte[] packed_code)
Force the specified value as output value of this gate. |
void |
setValue(int bit)
Force the specified value as output value of this gate. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int REG_GATE
public static final int INP_GATE
public static final int NBYTESG
public int gate_index
Constructor Detail |
---|
public Gate(int g_idx, int n_ins, int type, boolean out_gate)
g_idx
- index of gate within the circuit.n_ins
- number of input wires for this gate.type
- the type of this gate (e.g., input/regular).out_gate
- true if this gate goes to output.Method Detail |
---|
public void setInput(int ind, Gate in_gate)
ind
- Index of input wirein_gate
- Gate from which input is takenpublic void setOutput(int ind, boolean val)
ind
- Index of inputval
- binary output valuepublic void setValue(int bit)
bit
- The output value to set.public void markAliceBob(boolean alice)
alice
- true if it's Alice's inputpublic void setPackedCode(byte[] packed_code)
packed_code
- The code value to set.public boolean isInput()
public boolean isAliceInput()
public boolean isBobInput()
public boolean isOutput()
public void setOutput(boolean out_gate)
public boolean isAliceOutput()
public boolean isBobOutput()
public boolean isCorrect()
public byte[] getPackedCode(int bit)
bit
- the desginated binary value (integer) to be garbled.
public byte[] getCode(int bit)
bit
- the desginated binary value (integer) to be garbled.
public int getValue()
public byte[] getGarbledValue()
public void setGarbledValue(byte[] gdataCode)
gdataCode
- byte array containing garbeled value to set.public int genPermIndex(int index)
index
- - An index into the gate's truth table
public byte[] genKey(int index, int permuted_index)
index
- - An index into the truth table of the gatepermuted_index
- - Like index, but permuted
public byte generateEncPerm(int index, byte enc_key)
index
- - An index into the gate's truth tableenc_key
- - An encryption key (one time pad).
public byte[] generateEncOutput(int index, byte[] enc_key)
index
- - An index into the gate's truth tableenc_key
- - encryption key for this entry
public void generateEncGate()
public int gmeasureEncPayload()
public byte[] gextractEncPayload()
public int ginjectEncPayload(byte[] info, int start)
public int gmeasureSecPayload()
public byte[] gextractSecPayload()
public int ginjectSecPayload(byte[] info, int start)
public int gmeasureInpPayload()
public byte[] gextractInpPayload()
public int ginjectInpPayload(byte[] info, int start)
public int gmeasureOutPayload()
public byte[] gextractOutPayload()
public int ginjectOutPayload(byte[] info, int start)
public void evalGate()
public void evalGarbledGate(boolean alice_interpret, boolean bob_interpret)
alice_interpret
- - interpret Alice garbled outputbob_interpret
- - interpret Bob garbled outputpublic void printGate()
public int interpretCode()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |