A production grade library for facilitiating 1-out-of-2 oblivious transfer protocol among two parties
This library implements the Bellare-Micali 1-out-of-2 Oblivious Transfer (OT) protocol over an abstract prime-order elliptic curve group
Given a Sender holding two payloads
The sender samples a random scalar
The receiver samples a private scalar
The Receiver transmits
The Sender derives two symmetric encryption keys
The messages are encrypted into ciphertexts
The Receiver derives their targeted decryption key
The protocol guarantees security because the underlying Diffie-Hellman keys match perfectly at the chosen index:
At the unchosen index, computing the symmetric key requires solving the Computational Diffie-Hellman (CDH) problem over
OT-in-rust/
├── Cargo.toml
└── src/
├── lib.rs # Crate entry point, clean type re-exports, and integration tests
├── errors.rs # Strict domain-specific protocol error definitions
├── crypto.rs # Core cryptographic primitives (HKDF, Curve Math Wrapper, AEAD)
└── states/
├── mod.rs # State glue module
├── sender.rs # Sender state machine (Setup -> Transmit)
└── receiver.rs # Receiver state machine (Keys -> Decryption)
chacha20poly1305 = "0.10.1"
generic-ec = {version = "0.5.0", features=["all-curves"]}
hkdf = "0.13.0"
rand = { version = "0.8.5", features = ["std", "getrandom"] }
sha2 = "0.11.0"
zeroize = "1.8.2"