This project implements Yao's Garbled Circuit and is inspired by this repository.
- Ensure you have a compiler with OpenSSL support installed (e.g.,
gcc
). - Ensure OpenSSL development libraries are installed on your system (e.g.,
libssl-dev
on Debian-based systems).
To compile the project, you can use the provided Makefile
. Open a terminal and run the following command:
make
This will compile the source code and produce an executable named garbled_circuit
.
You can run the program in different modes: as a garbler or as an evaluator. Additionally, you can run tests to verify functionality.
To run the program as a garbler:
./garbled_circuit garbler <bit> <gate>
- Replace
<bit>
with0
or1
. - Replace
<gate>
withAND
orXOR
. - You will be prompted to input four 32-digit hexadecimal keys.
To run the program as an evaluator:
./garbled_circuit evaluator <bit> <gate>
- Replace
<bit>
with0
or1
. - Replace
<gate>
withAND
orXOR
.
To run tests, use:
make test
This will execute the program in test mode.
To remove the compiled executable and object files, run:
make clean