Documentation ¶
Index ¶
- func CheckcreateMerkleTreeForEncInp(encryptedGateOutputs [totNumOfEncOutVecToMer][hashFunctionOutputBitSize]byte, ...) bool
- func Decrypt(key [keySize]byte, encryptedtext [hashFunctionOutputBitSize]byte) [32]byte
- func Enc(key [keySize]byte, plainText [32]byte) [hashFunctionOutputBitSize]byte
- func Encode(inputVectors [noOfInputGates][buffer_size]byte, key [keySize]byte, ...) ([totalNumberOfGates][hashFunctionOutputBitSize]byte, ...)
- func ExecuteFairSwap()
- func Extract(encodedGateOutputs [totNumOfEncOutVecToMer][hashFunctionOutputBitSize]byte, ...) ([][][hashFunctionOutputBitSize]byte, [][buffer_size]byte, []int)
- func Mproof(index int, ...) [][hashFunctionOutputBitSize]byte
- func Operation(Op int, operationInputs [][hashFunctionOutputBitSize]byte, ...) [32]byte
- func Receiver(authReceiver *bind.TransactOpts, client *ethclient.Client, ...)
- func ReceiverMerkleTreeCreate(encryptedGateOutputs [totNumOfEncOutVecToMer][hashFunctionOutputBitSize]byte) [2*totNumOfEncOutVecToMer - 1][hashFunctionOutputBitSize]byte
- func Sender(authSender *bind.TransactOpts, client *ethclient.Client, ...)
- func SetSenderReceiver(a *bind.TransactOpts, x common.Address, y common.Address, ...)
- type SenderToContractStruct
- type SenderToReceiverStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckcreateMerkleTreeForEncInp ¶
func CheckcreateMerkleTreeForEncInp(encryptedGateOutputs [totNumOfEncOutVecToMer][hashFunctionOutputBitSize]byte, merklerootforEncInput [hashFunctionOutputBitSize]byte) bool
fn CheckcreateMerkleTreeForEncInp constructs merkletree and compares between the merkleroot got from construction and merkleroot passed as function parameter input parameters encryptedGateOutputs : Vectors of encrypted output of the circuit gates merklerootforEncInput : merkle root of Encrypted Input Returns bool value,true if merklerootforcircuit matches with the merkleroot got from construction,else false
func Decrypt ¶
Decrypt function The function is used to decrypt(XOR) the given vector. Input Parameters key : The key with which the XORing is done. encryptedtext : the input vector Returns the plainText output Operation performed : encryptedtext (XOR) key
func Enc ¶
Encrypt function The function is used to encrypt(XOR) the given vector. Input Parameters key : The key with which the XORing is done. plainText : the input vector Returns the encrypt output Operation performed : plainText (XOR) key
func Encode ¶
func Encode(inputVectors [noOfInputGates][buffer_size]byte, key [keySize]byte, circuitObjects [totalNumberOfGates]circuit, MRx [hashFunctionOutputBitSize]byte) ([totalNumberOfGates][hashFunctionOutputBitSize]byte, [totalNumberOfGates][32]byte)
The Encode function input parameters : inputVectors : The set of all input vectors key : The key with which the encryption function will be performed circuitObjects : An array of circuit objects that contains info related to eacg gate MRx : Merkle root of input vectors.Specific to this particular circuit. Returns : An array of encrypted vectors
func ExecuteFairSwap ¶
func ExecuteFairSwap()
func Extract ¶
func Extract(encodedGateOutputs [totNumOfEncOutVecToMer][hashFunctionOutputBitSize]byte, key [keySize]byte, circuitObjects [totalNumberOfGates]circuit, merkletree [2*totNumOfEncOutVecToMer - 1][hashFunctionOutputBitSize]byte, Receiver_MerkleRootOfEncInp [hashFunctionOutputBitSize]byte) ([][][hashFunctionOutputBitSize]byte, [][buffer_size]byte, []int)
func Mproof ¶
func Mproof(index int, merkletree [2*totNumOfEncOutVecToMer - 1][hashFunctionOutputBitSize]byte) [][hashFunctionOutputBitSize]byte
fn Mproof Input parameters inpdex(int) - the index of the gate merkletree([2*totNumOfEncOutVecToMer-1][32]byte) - merkle tree for encodedGateOutputs Return Parameters tree([depth][32]byte) - the merkle proof
func Receiver ¶
func Receiver(authReceiver *bind.TransactOpts, client *ethclient.Client, channel_SenToRec chan []byte, channel_RecToMainIni chan string, channel_RecToMainRev chan string)
Receiver function The functoin executes honest receiver's role in fairswap Input parameters: authReceiver(*bind.TransactOpts) - the receiver in the blockchain client()*backends.SimulatedBackend) - blockchain(here it is a backend blockchain) channel_SenToRec(chan []byte) - to receiver the byte array from the sender channel_RecToMainIni(chan string) - to notify the main function for the completion of initialization phase channel_RecToMainRev(chan string) - to notify the main function for the completion of reveal phase
func Sender ¶
func Sender(authSender *bind.TransactOpts, client *ethclient.Client, channel_SenToRec chan []byte, channel_SenToMain chan string)
Sender function The functoin executes honest sender's role in fairswap Input parameters: authsender(*bind.TransactOpts) - the sender in the blockchain client (*ethclient.Client) - blockchain(here it is a Ethereum blockchain) channel_SenToRec(chan []byte) - to send the byte array to the receiver channel_SenToMain(chan string) - to communicate with the main function