Lux FHE Examples

Multi-language FHE examples

View the Project on GitHub luxfhe/examples

Lux FHE Examples

Multi-language examples for the Lux FHE (Fully Homomorphic Encryption) ecosystem.

🌍 Language Support

Language Directory Status Use Case
C c/ ✅ Full Embedded systems, native libs
C++ cpp/ ✅ Full High-performance apps
Python python/ ✅ Full ML, data science, agents
Go go/ ✅ Full Backend services, MPC
Rust rust/ ✅ Full Crypto, WASM, performance
Ruby ruby/ 🚧 Beta Web apps, scripts
Elixir elixir/ 🚧 Beta Distributed systems
Haskell haskell/ 🚧 Beta Formal verification
Node.js node/ ✅ Full Web, serverless, agents

🚀 Quick Start

Python

pip install luxfhe
python python/basic.py

Go

cd go
go run main.go

Rust

cd rust
cargo run

Node.js

cd node
npm install
npx tsx basic.ts

C/C++

cd c
make
./fhe_demo

📚 Example Categories

Basic FHE Operations

Every language includes a basic example demonstrating:

Private Machine Learning

See python/private_ml.py:

Private Agents

See python/private_agents.py and node/private_agents.ts:

🏗️ Architecture

┌─────────────────────────────────────────────────────────────────┐
│                      Your Application                           │
├─────────────────────────────────────────────────────────────────┤
│  ┌────────────────────────────────────────────────────────┐     │
│  │    Language Bindings (Python, Go, Rust, Node, etc.)    │     │
│  └────────────────────────────────────────────────────────┘     │
│                              │                                   │
│  ┌────────────────────────────────────────────────────────┐     │
│  │              Lux FHE Compiler (LLVM)                   │     │
│  │    github.com/luxfi/fhe-compiler                        │     │
│  └────────────────────────────────────────────────────────┘     │
│                              │                                   │
│  ┌─────────────┬─────────────┬─────────────┬──────────────┐     │
│  │   Torus     │  Torus-ML   │  Torus-NTT  │  Torus-FFT   │     │
│  │  (Runtime)  │    (ML)     │  (Accel)    │   (Accel)    │     │
│  └─────────────┴─────────────┴─────────────┴──────────────┘     │
│                              │                                   │
│  ┌────────────────────────────────────────────────────────┐     │
│  │         Core: github.com/luxfi/fhe + lattice           │     │
│  └────────────────────────────────────────────────────────┘     │
└─────────────────────────────────────────────────────────────────┘

Core Libraries (github.com/luxfi)

Documentation (github.com/luxfhe)

📄 License

Apache 2.0 - See LICENSE.


Built by Lux Network & Hanzo AI