Pre-release vfhe is under active development and has not been audited. APIs may change between versions.
vfhe 0.0.4 is out · what's new →

The vfhe library

An open-source Python library, built on native C kernels, for zero-knowledge proofs, fully homomorphic encryption, and verifiable FHE.

$pip install vfhe

Python 3.11–3.15 · Linux and macOS · x86_64 (arm64 in progress) · Apache-2.0

Arith
Available

Efficient Arithmetic Backends

Fast native arithmetic over power-of-two cyclotomic rings in RNS form, finite and extension fields, multiprecision integers, and complex numbers. The kernels are optimized for x86_64 with AVX-512 IFMA, with a portable fallback for other CPUs, and run multithreaded. Optimized arm64 support is in progress.

ZKP
Preview

Zero-Knowledge Proofs

The building blocks of succinct arguments, over finite fields and over Rq: a framework for polynomial IOPs with sumcheck, GKR, and lookup and range arguments, the Basefold and BatchFold polynomial commitments, and Fiat-Shamir. Complete SNARKs built from these blocks are in progress.

FHE
Available

Fully Homomorphic Encryption

The CKKS and BFV schemes over RNS, on a Module-LWE and GSW core with key switching, automorphisms, and ring switching, together with bootstrapping implementations (CGGI16, GP25, CHKS25). It is all built on the same proof-friendly arithmetic as the proof systems, so that encrypted computations can be proven.

vfhe
Work in progress

Verifiable FHE

Proofs that an encrypted computation was carried out correctly. vfhe records every operation of an FHE computation and turns the record into the witness of an arithmetization: Batch, Pack, and Prove for now, with more to come. Proving these witnesses end to end is the next step.

A first look

Compute on encrypted data, record the computation for a proof, and prove a claim about committed polynomials. Every snippet runs as shown on vfhe 0.0.4.

Multiply two encrypted vectors with CKKS, at a toy ring size.

from vfhe.arith import Ring
from vfhe.fhe import CKKS_Scheme

scheme = CKKS_Scheme(Ring(256, 300), scaling_factor=2**49)  # toy size: 128 slots
key = scheme.key_gen(3.2)
scheme.rlk = scheme.gen_rlk(key, key)  # relinearization key

ct_a = scheme.encrypt(scheme.encode([1.5 + 0.5j, 2.0]), key)
ct_b = scheme.encrypt(scheme.encode([0.5 - 0.5j, 3.0]), key)

ct = ct_a * ct_b  # multiply under encryption
print(scheme.decode(scheme.decrypt(ct, key))[:2])  # ≈ [1-0.5j, 6]
The full walkthrough, with threads, processes and memory, is in the usage guide →