Working examples of end-to-end FHE apps on the Niobium Fog — in every example the server side runs on ciphertexts only, and the clients hold all private keys. The Fog never sees a plaintext.
Each example is a self-contained top-level directory: sources, build setup, tests, bench harness, and design docs all live under the project's own directory. Nothing is commingled at the repo root.
| directory | what it is | language | quick command |
|---|---|---|---|
| golden/ | computes φ on encrypted data using Newton's method — the Fog depth smoke test | C++ (CMake) | cd golden && make test-golden-local |
| fhe-messenger/ | XMPP-shaped FHE maildrop (fhexmpp) — roster, JIDs, <message> stanzas, encrypted triage |
Rust + C++ kernel | cd fhe-messenger && make gates |
golden/
The server solves for φ = (1 + √5)/2 with Newton's method, entirely on ciphertexts: three iterations of y ← 0.5·y·(3 − 5y²) converge to 1/√5, and the client then recovers φ = 0.5 + 2.5y from the encrypted output — the only plaintext operation in the whole run. The circuit is ~13 ciphertext×ciphertext multiplies on a depth-20 schedule, recorded once and replayed either by the local simulator or by the Fog, exercising record/replay, hollow trace upload, and client-side decryption end to end.
Verified to 10 digits on a real Fog job (φ = 1.618033988748, error
2.1e-12). A 50-round-trip serial Fog benchmark harness (golden/bench/)
records per-iteration latency and correctness.
fhe-messenger/ (fhexmpp)
An XMPP-shaped FHE maildrop: a Rust CLI (fhexmpp) manages bare JIDs,
rosters, and <message> stanzas client-side, while the recipient's
server-side maildrop holds only public keys + ciphertexts and runs one
recorded ct×ct triage circuit over the Fog — matching each stanza's
subject against the recipient's encrypted rule box and returning only an
encrypted match vector that clients decrypt and read locally. Secret keys
never leave the clients. Verified with a real Fog round trip (job
1145db61). Architecture diagrams (Graphviz dot sources + rendered SVGs)
live under fhe-messenger/design/.
Layout
.
├── README.md # this file
├── LICENSE # BSD-3-Clause
├── golden/ # self-contained: sources, CMake/Make, bench, README
│ ├── circuit.h / client.cpp / server.cpp / decrypt.cpp / twin.cpp
│ ├── CMakeLists.txt, Makefile
│ └── bench/ # Fog round-trip benchmark harness + run dirs (ignored)
└── fhe-messenger/ # self-contained: Rust crate over a C++ kernel
├── src/ # Rust CLI + xmpp helpers + kern/ C++ kernel
├── Makefile, Cargo.toml, build.rs
└── design/ # DESIGN.md + topology/pipeline/circuit dot+SVG
The repo root holds only this README and the LICENSE; each project is built and tested entirely within its own directory.
Prerequisites
Both examples compile against a Release-built
niobium-client checkout
(each project defaults to ../../niobium-client relative to itself — the
usual case is the niobium-client checkout sitting beside this repo):
(cd ../niobium-client && make release) # once
cd golden && make test-golden-local # local gate (no Fog needed)
cd fhe-messenger && make gates # local gate (no Fog needed)
cd golden && make fog-golden # real Fog round trip
cd fhe-messenger && make fog-submit # real Fog round trip
The Fog targets additionally need fogrs (Fog CLI) + ~/.fog/credentials.
Provenance
Sources generated by the Niobium FHE Application Design AI Assistant, BSD-3-Clause; underlying cryptography lives upstream in niobium-client (Apache-2.0) and its vendored OpenFHE build — compiling against it does not relicense any of that code.