This repository is designed to help OpenFHE beginners practice and understand the core functionalities of OpenFHE CKKS implementation.
- C++ Compiler (gcc/g++ >= 9.4.0)
- CMake (>= 3.5.1)
- Make
- Git
- OpenFHE Library
The OpenFHE library must be installed on your system. You can find:
- Source code: OpenFHE GitHub Repository
- Installation guide: OpenFHE Documentation
# Check C++ compiler
g++ --version
# Check CMake version
cmake --version
# Check Make version
make --version
# Check Git version
git --version- Clone the repository
git clone --recursive https://github.com/oksuman/OpenFHE-tutorial.git
cd OpenFHE-tutorialNote: If you have already clone the repository without --recursive, run:
git submodule init
git submodule update- Create and enter build directory
mkdir build
cd build- Configure and build
cmake ..
makeThe tutorial examples demonstrate basic CKKS operations:
# Build and run tutorial1
cd build
make tutorial1
./tutorial/tutorial1
# Build and run tutorial2
make tutorial2
./tutorial/tutorial2The practice problems are designed for you to implement specific functionalities:
-
Each practice directory contains:
- Header file (
.h) with function declarations - Source file (
.cpp) with TODO implementations - Test file for verification
- Header file (
-
To work on practice problems:
- Implement the required functions in the corresponding
.cppfiles - Build and run tests to verify your implementation
- Implement the required functions in the corresponding
-
Building and running tests:
# Build all tests
cd build
make practice1_test practice2_test practice3_test
# Run individual tests
./test/practice1_test
./test/practice2_test
./test/practice3_test
# Or run all tests
ctestOpenFHE-Tutorial/
├── CMakeLists.txt
├── practice1/ # Practice problem 1
├── practice2/ # Practice problem 2
├── practice3/ # Practice problem 3
├── tutorial/ # Tutorial examples
├── test/ # Test files
└── build/ # Build directory (generated)
- Solutions for practice problems are available in the
solutionbranch (git checkout solution)