This module implements the Oblivous Transfer with the following algorithms:
- RSA: simple RSA encryption based OT. Each transfer requires one RSA operation.
- Chou Orlandi OT: Diffie-Hellman - like fast OT algorithm.
The CO implementation now exposes pure helper functions so applications can
prepare, encrypt, and decrypt OT payloads without depending on the streaming
IO API. Use:
GenerateCOSenderSetupto sample the sender's randomness and public point.EncryptCOCiphertextsto turnWirelabels and evaluator points into OT ciphertexts.BuildCOChoicesto build evaluator curve points deterministically from the sender's public key.DecryptCOCiphertextsto decode the evaluator's chosen labels.
These helpers accept any io.Reader for randomness, which makes deterministic
testing straightforward. The streaming CO type is now a small wrapper around
the same helpers, so both styles always share the exact same cryptographic core.
goos: darwin
goarch: amd64
pkg: github.com/markkurossi/mpc/ot
cpu: Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
| Algorithm | ns/op | ops/s |
|---|---|---|
| RSA-2048 | 8,086,829 | 124 |
| CO | 152,745 | 6,545 |
| COT semi-honest | 3,007 | 332,600 |
| COT malicious | 3,703 | 270,000 |
The COTSender and COTReceiver implement correlated OT with the
IKNP protocol.
- malicious IKNP
- COT send / receive
- random send / receive
- rename
COTSenderandCOTReceivertoIKNPSenderandIKNPReceiver - new
COTSenderandCOTReceiverfor correlated OT send and receive - new
ROTSenderandROTReceiverfor random OT send and receive - SoftSpokenOT