-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab2abcd
commit 7ef1efb
Showing
9 changed files
with
602 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// io.go | ||
// | ||
// Copyright (c) 2023 Markku Rossi | ||
// | ||
// All rights reserved. | ||
|
||
package ot | ||
|
||
// IO defines an I/O interface to communicate between peers. | ||
type IO interface { | ||
// SendData sends binary data. | ||
SendData(val []byte) error | ||
|
||
// SendUint32 sends an uint32 value. | ||
SendUint32(val int) error | ||
|
||
// Flush flushed any pending data in the connection. | ||
Flush() error | ||
|
||
// ReceiveData receives binary data. | ||
ReceiveData() ([]byte, error) | ||
|
||
// ReceiveUint32 receives an uint32 value. | ||
ReceiveUint32() (int, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// ot.go | ||
// | ||
// Copyright (c) 2023 Markku Rossi | ||
// | ||
// All rights reserved. | ||
|
||
package ot | ||
|
||
// OT defines Oblivious Transfer protocol. | ||
type OT interface { | ||
// InitSender initializes the OT sender. | ||
InitSender(io IO) error | ||
|
||
// InitReceiver initializes the OT receiver. | ||
InitReceiver(io IO) error | ||
|
||
// Send sends the wire labels with OT. | ||
Send(wires []Wire) error | ||
|
||
// Receive receives the wire labels with OT based on the flag values. | ||
Receive(flags []bool) ([]Label, error) | ||
} |
Oops, something went wrong.