public class GarbledWire extends java.lang.Object implements java.io.Serializable
Like, a standard
Wire in a non-garbled
GarbledWire can carry one of two values.
However, these values, as its name suggests, are garbled. Meaning that the actual boolean value of the wire is encoded and
cannot be determined from the garbled value.
|Constructor and Description|
public GarbledWire(javax.crypto.SecretKey valueAndSignalBit)
GarbledWireand assigns it a value and signalBit.
The least significant bit of the underlying
byte of the
SecretKey is the signal bit.
valueAndSignalBit- A secretKey containing the
GarbledWire's garbled value.
public javax.crypto.SecretKey getValueAndSignalBit()
GarbledWire, and the least significant bit of the underlying
byteis the signal bit.
public byte getSignalBit()
When we are assigning possible values to a wire we have to randomly generate a signal bit.
If the signal bit is 0, then the 0-encoding has a 0 as its least significant bit and the 1-encoding has a 1.
If the signal bit is a 1, then the 0-encoding has a 1 as its least significant bit and the 1 encoding has a 0.
What we are returning here is the last bit on the Wire which we also call the signal bit.
We are not returning the initial signal bit that determined which bit to put on each wire as this information cannot be recovered (if it could be, we would be able to determine the actual value of a garbled wire and thus it would not be garbled.)
See Fairplay - A Secure Two-Party Computation System by Dahlia Malkhi, Noam Nisan, Benny Pinkas, and Yaron Sella. Section 4.2 describes in more detail how the signal bit works.