Target: OpenFHE v1.4.2
- CKKS: Approximate arithmetic on encrypted real/complex numbers
- BFV: Exact arithmetic on encrypted integers
- BGV: Exact arithmetic on encrypted integers (SIMD)
- BinFHE: Boolean operations on encrypted bits
- Scheme Switching: Switch between CKKS and FHEW for hybrid operations
- Proxy Re-Encryption (PRE): Delegate decryption rights without revealing keys
- Comparison Operations: Find min/max values and argmin/argmax indices via scheme switching
- Bootstrapping: CKKS and BinFHE bootstrapping for unlimited depth computations
- Function Evaluation: Evaluate arbitrary smooth functions on encrypted data using Chebyshev approximation
- Pre-defined functions:
EvalLogistic,EvalSin,EvalCos,EvalDivide - Custom functions:
EvalChebyshevFunctionwith Go callbacks (anyfunc(float64) float64) - Batch optimization:
EvalChebyshevCoefficients+EvalChebyshevSeriesfor reusing coefficients
- Pre-defined functions:
# Development build (fast, uses shared libraries)
make build
# Production build (static binary, slower)
make build-staticThe project supports two build modes:
Fast iteration with shared libraries - ideal for development and testing.
make build # Build with shared libraries
make test # Run tests
make run-examples # Run all examplesBuild times:
- First-time OpenFHE build: 3-5 minutes (builds C++ OpenFHE library)
- First-time C++ wrapper compilation: ~2 minutes (CGO compiles C++ wrapper files)
- Subsequent Go builds/tests: <0.1 seconds (Go build cache)
- After C++ wrapper changes: ~2 minutes (only recompiles changed C++ files)
- After Go code changes: <0.1 seconds (doesn't recompile C++)
- OpenFHE only:
make build_openfhe(builds shared libraries only)
CGO automatically handles compiling the C++ wrapper files and intelligently caches them. The cache only invalidates when C++ files actually change, not when Go code changes, providing very fast iteration.
Standalone binaries with statically linked OpenFHE - ideal for deployment.
make build-static # Build with static librariesBuild times:
- First-time static build: 3-5 minutes (builds C++ OpenFHE static libraries)
- Subsequent static builds: 30-120 seconds (relinks all static
.afiles) - Static libs only:
make build_openfhe_static
Static builds produce self-contained binaries but are slower due to relinking all libraries on each build.
To switch from one mode to another, clean the OpenFHE installation:
make clean_openfhe # Remove OpenFHE build artifacts
make build # Rebuild with desired modeThe Makefile automatically handles:
- Cloning OpenFHE v1.4.2 source
- Building and installing OpenFHE C++ libraries
- Setting appropriate CGO flags for linking
No additional tools or manual configuration required.
make testmake run-examples
See examples and tests for usage
- boolean-ap
- boolean-lmkcdey
- boolean-truth-tables
- boolean
- advanced-real-numbers-128
- advanced-real-numbers
- comparison-argmin (min/max with argmin/argmax via scheme switching)
- function-evaluation (logistic, sin, cos, custom functions, batch optimization)
- inner-product
- interactive-bootstrapping
- iterative-ckks-bootstrapping
- linearwsum-evaluation
- plaintext-operations
- polynomial-evaluation
- pre-buffer
- pre-hra-secure
- rotation
- scheme-switching
- simple-ckks-bootstrapping
- simple-complex-numbers (complex number operations and bootstrapping)
- simple-integers-bgvrns
- simple-integers-serial-bgvrns
- simple-integers-serial
- simple-integers
- simple-real-numbers-serial
- simple-real-numbers
- tckks-interactive-mp-bootstrapping-Chebyschev
- tckks-interactive-mp-bootstrapping
- threshold-fhe-5p
- threshold-fhe