API reference

Each module is a self-contained folder under modules/. A module is Python-facing (ships a python/ package + a cdef exposing its C to Python) or internal C-only (contributes compiled kernels used by other modules, no Python symbols). A Python-facing module’s public API is its __init__ re-exports.

Module

Kind

What it provides

arith

Python-facing

RNS polynomial arithmetic over Z_q[X]/(X^N+1): incomplete NTTs, complex FFTs, general multiprecision, basic number theory procedures, and multilinear extensions

util

Python-facing

The native handle (ffi/lib), the engine picker and the pure-Python host probes (vfhe.util._cpu), vfhe.util.info, custom kernel builds (vfhe.util.kernels), and the C substrate (aligned allocation, the thread limit and parallel loop)

crypto

Python-facing

Basic primitives: the library’s randomness (BLAKE3-seeded PRNG, AES-CTR RNG, Box-Muller sampling, a seeded transcript sampler) and BLAKE3 Merkle trees

mlwe

Python-facing

LWE / Module-LWE and MGSW: key generation, encryption, key-switching, arithmetic, and ring morphisms

fhe

Python-facing

Schemes on top of mlwe: CKKS (encode/encrypt/rescale/rotate/multiply), CGGI16 functional bootstrap, GP25 sparse-amortized bootstrap

piop

Python-facing

Sketch of IOP prover/verifier framework (currently under development)

polycom

Python-facing

Basefold polynomial commitments over a foldable Reed-Solomon code (currently under development)

circuit

Python-facing

Arithmetic circuits (wire format in proto/) and their polynomial export to arith (currently under development)

vfhe

placeholder

the top-level assembly that will tie the modules together

Still to come, each its own module when it has code: a circuit compiler frontend lowering programs to GKR circuits, and the SNARK layer over the PIOP and its commitments.

Every module’s Python package is documented here from its docstrings, its public API being what vfhe.<module> exports. The C headers of crypto and util are documented from their Doxygen blocks; the other modules’ headers join as their blocks reach that standard.