Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeBristolFashionOutput(binaryOutput []uint8) (string, error)
- func Decrypt(d []int32, Y [][]byte) []uint8
- func SetShaStateBristolInput(state []uint64) ([]uint8, error)
- type Circuit
- type EncFunc
- type GarbleCircuit
- func (garcir *GarbleCircuit) Encrypt(startIndex int, input []uint8) [][]byte
- func (garcir *GarbleCircuit) EvaluateGarbleCircuit(garbledMsg *GarbleCircuitMessage, input [][]byte) ([][]byte, error)
- func (garcir *GarbleCircuit) GenerateGarbleWire(startIndex, endIndex int) ([][]byte, [][]byte)
- func (garcir *GarbleCircuit) GetOutputWire() [][][]byte
- type GarbleCircuitMessage
- func (*GarbleCircuitMessage) Descriptor() ([]byte, []int)deprecated
- func (x *GarbleCircuitMessage) GetD() []int32
- func (x *GarbleCircuitMessage) GetF() []*HalfGateMessage
- func (x *GarbleCircuitMessage) GetHOutputWire0() [][]byte
- func (x *GarbleCircuitMessage) GetHOutputWire1() [][]byte
- func (x *GarbleCircuitMessage) GetStartCount() []byte
- func (x *GarbleCircuitMessage) GetX() [][]byte
- func (*GarbleCircuitMessage) ProtoMessage()
- func (x *GarbleCircuitMessage) ProtoReflect() protoreflect.Message
- func (x *GarbleCircuitMessage) Reset()
- func (x *GarbleCircuitMessage) String() string
- type Gate
- type HalfGateMessage
- func (*HalfGateMessage) Descriptor() ([]byte, []int)deprecated
- func (x *HalfGateMessage) GetTE() []byte
- func (x *HalfGateMessage) GetTG() []byte
- func (x *HalfGateMessage) GetWireIndex() int32
- func (*HalfGateMessage) ProtoMessage()
- func (x *HalfGateMessage) ProtoReflect() protoreflect.Message
- func (x *HalfGateMessage) Reset()
- func (x *HalfGateMessage) String() string
Constants ¶
View Source
const ( XOR Gate = "XOR" AND Gate = "AND" INV Gate = "INV" // Also called NOT EQ Gate = "EQ" KBitMod8 = 16 // 8*16=128 AES128 = 128 AES256 = 256 )
Variables ¶
View Source
var ( // ErrNONSUPPORTGATE is returned if the gate is not supportted. ErrNONSUPPORTGATE = errors.New("the gate is not supportted") // ErrPARSEFAILURE is returned if the parse failures. ErrPARSEFAILURE = errors.New("the parse failures") // ErrNONIMPLEMENT is returned if the gate is not implemented. ErrNONIMPLEMENT = errors.New("the gate is not implemented") // ErrInputBit is returned if the bit input is wrong. ErrInputBit = errors.New("the bit input is wrong") // ErrInputSize is returned if the size of input is wrong. ErrInputSize = errors.New("the size of input is wrong") )
View Source
var File_github_com_getamis_alice_crypto_circuit_message_proto protoreflect.FileDescriptor
Functions ¶
func DecodeBristolFashionOutput ¶
To Hex
func SetShaStateBristolInput ¶
Types ¶
type Circuit ¶
type Circuit struct {
// contains filtered or unexported fields
}
----
func LoadBristol ¶
func (*Circuit) Garbled ¶
func (cir *Circuit) Garbled(kBit int, input []uint8, f EncFunc) (*GarbleCircuit, *GarbleCircuitMessage, error)
Garbled Circuit: Two Halves Make a Whole Reducing data Transfer in Garbled Circuits using Half Gates Fig-2. The permitted inputs of Kbit are 128 or 256
type GarbleCircuit ¶
func (*GarbleCircuit) Encrypt ¶
func (garcir *GarbleCircuit) Encrypt(startIndex int, input []uint8) [][]byte
func (*GarbleCircuit) EvaluateGarbleCircuit ¶
func (garcir *GarbleCircuit) EvaluateGarbleCircuit(garbledMsg *GarbleCircuitMessage, input [][]byte) ([][]byte, error)
Evaluate: procedure Ev
func (*GarbleCircuit) GenerateGarbleWire ¶
func (garcir *GarbleCircuit) GenerateGarbleWire(startIndex, endIndex int) ([][]byte, [][]byte)
func (*GarbleCircuit) GetOutputWire ¶
func (garcir *GarbleCircuit) GetOutputWire() [][][]byte
type GarbleCircuitMessage ¶
type GarbleCircuitMessage struct { F []*HalfGateMessage `protobuf:"bytes,1,rep,name=f,proto3" json:"f,omitempty"` D []int32 `protobuf:"varint,2,rep,packed,name=d,proto3" json:"d,omitempty"` HOutputWire0 [][]byte `protobuf:"bytes,3,rep,name=HOutputWire0,proto3" json:"HOutputWire0,omitempty"` HOutputWire1 [][]byte `protobuf:"bytes,4,rep,name=HOutputWire1,proto3" json:"HOutputWire1,omitempty"` StartCount []byte `protobuf:"bytes,5,opt,name=startCount,proto3" json:"startCount,omitempty"` X [][]byte `protobuf:"bytes,6,rep,name=x,proto3" json:"x,omitempty"` // contains filtered or unexported fields }
func (*GarbleCircuitMessage) Descriptor
deprecated
func (*GarbleCircuitMessage) Descriptor() ([]byte, []int)
Deprecated: Use GarbleCircuitMessage.ProtoReflect.Descriptor instead.
func (*GarbleCircuitMessage) GetD ¶
func (x *GarbleCircuitMessage) GetD() []int32
func (*GarbleCircuitMessage) GetF ¶
func (x *GarbleCircuitMessage) GetF() []*HalfGateMessage
func (*GarbleCircuitMessage) GetHOutputWire0 ¶
func (x *GarbleCircuitMessage) GetHOutputWire0() [][]byte
func (*GarbleCircuitMessage) GetHOutputWire1 ¶
func (x *GarbleCircuitMessage) GetHOutputWire1() [][]byte
func (*GarbleCircuitMessage) GetStartCount ¶
func (x *GarbleCircuitMessage) GetStartCount() []byte
func (*GarbleCircuitMessage) GetX ¶
func (x *GarbleCircuitMessage) GetX() [][]byte
func (*GarbleCircuitMessage) ProtoMessage ¶
func (*GarbleCircuitMessage) ProtoMessage()
func (*GarbleCircuitMessage) ProtoReflect ¶
func (x *GarbleCircuitMessage) ProtoReflect() protoreflect.Message
func (*GarbleCircuitMessage) Reset ¶
func (x *GarbleCircuitMessage) Reset()
func (*GarbleCircuitMessage) String ¶
func (x *GarbleCircuitMessage) String() string
type HalfGateMessage ¶
type HalfGateMessage struct { TG []byte `protobuf:"bytes,1,opt,name=tG,proto3" json:"tG,omitempty"` TE []byte `protobuf:"bytes,2,opt,name=tE,proto3" json:"tE,omitempty"` WireIndex int32 `protobuf:"varint,3,opt,name=wireIndex,proto3" json:"wireIndex,omitempty"` // contains filtered or unexported fields }
func (*HalfGateMessage) Descriptor
deprecated
func (*HalfGateMessage) Descriptor() ([]byte, []int)
Deprecated: Use HalfGateMessage.ProtoReflect.Descriptor instead.
func (*HalfGateMessage) GetTE ¶
func (x *HalfGateMessage) GetTE() []byte
func (*HalfGateMessage) GetTG ¶
func (x *HalfGateMessage) GetTG() []byte
func (*HalfGateMessage) GetWireIndex ¶
func (x *HalfGateMessage) GetWireIndex() int32
func (*HalfGateMessage) ProtoMessage ¶
func (*HalfGateMessage) ProtoMessage()
func (*HalfGateMessage) ProtoReflect ¶
func (x *HalfGateMessage) ProtoReflect() protoreflect.Message
func (*HalfGateMessage) Reset ¶
func (x *HalfGateMessage) Reset()
func (*HalfGateMessage) String ¶
func (x *HalfGateMessage) String() string
Click to show internal directories.
Click to hide internal directories.