Skip to content

kazuakiishiguro/toy-garbled-circuit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of Yao's Garbled Circuit

This project implements Yao's Garbled Circuit and is inspired by this repository.

Prerequisites

  • 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).

Building the Project

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.

Usage

You can run the program in different modes: as a garbler or as an evaluator. Additionally, you can run tests to verify functionality.

Running as Garbler

To run the program as a garbler:

./garbled_circuit garbler <bit> <gate>
  • Replace <bit> with 0 or 1.
  • Replace <gate> with AND or XOR.
  • You will be prompted to input four 32-digit hexadecimal keys.

Running as Evaluator

To run the program as an evaluator:

./garbled_circuit evaluator <bit> <gate>
  • Replace <bit> with 0 or 1.
  • Replace <gate> with AND or XOR.

Running Tests

To run tests, use:

make test

This will execute the program in test mode.

Cleaning Up

To remove the compiled executable and object files, run:

make clean

About

Toy implementation of Yao's Garbled Circuit protocol in C under 500 lines of code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published