Changelog¶
All notable changes to this project are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning. Until 1.0.0, minor versions may contain breaking changes.
Unreleased¶
Added¶
vfhe.crypto.random.Random, the source a scheme’s samplers draw from, and arandom=parameter onMLWE_Scheme,CKKS_Scheme,BFV_Scheme,LWE_Key,Verifierand everyrandom_*sampler of arith: a seeded source makes a scheme reproducible on every engine. In C every sampler takes aRandom(random.h),NULLbeing the entropy stream;random_belowandnormal_randomreplaceentropy_uniform_belowandnormal_from_entropy.A CUDA extension,
_vfhe_cuda, built beside the engines when the build finds a toolkit (-Dcuda=auto|enabled|disabled) and loaded byvfhe.util.gpu. With a device,rnsgains acudabackend:Ring(..., backend="cuda")holds its elements on the device, where add, subtract and negate run, andPolynomial.to_backendmoves an element between host and device. The wheels carry no extension; a build from the sdist withnvccdoes.Every module’s Python API on the documentation site, split by concern where a module is large, with links between its own pages; the site’s Project section is contributing, security, support and this changelog.
Changed¶
BREAKING:
vfhe.cryptois three subpackages imported like util’s,random,hashandmerkle, with nothing re-exported.Random()replaces theentropymodule andseeded_below_manytheseededmodule;entropy.deterministic,entropy_pinandentropy_unpinare gone, a reproducible scheme being built over a seededRandom.digest(data)is the one hash function, BLAKE3 of a byte string, in place ofhash_bytes,chain_digestand the typed digests;DigestChainis the chain, and tagging a transcript’s primitives is piop’selement_digest.Merkletakes packed leaf digests alone,Merkle(digests), and an opening isbytes;MerklePath, trees over leaf objects andfrom_digestsare gone.BREAKING (C): crypto’s headers own their prefixes: the hash functions are
hash_blake3,hash_blake3_batch,hash_blake3_chainandhash_blake3_stream_*, leavingblake3_to the vendored library;entropy.hfolded intorandom.h, whoserandom_bytes(NULL, ...)is the stream;wipe.his util’s.BREAKING:
kernels.ExtensionBuilderis the functionskernels.build,kernels.compileandkernels.directory, each taking(sources, declarations, *, engine=None, cc=None).BREAKING:
vfhe.infoisvfhe.util.info, and the report ispython -m vfhe.util.info: every command the library offers lives undervfhe.util, besidekernelsandbenchmark.BREAKING: the benchmarks are pytest-benchmark tests, each module’s
python/bench/installed as itsbenchpackage:python -m vfhe.benchmarktimes them on an install (pip install 'vfhe[benchmark]') andmake benchmarkon every engine of a checkout, with saved runs and comparison; the complete depth ofmake testruns each once. The harness undertools/bench,make benchand the C benchmarks are gone.BREAKING:
vfhe.util.iohas one type class,Codec;EncoderandDecoderare folded into it,read_exactlyis no longer exported, andBoolCodec,FloatCodecandStrCodecare gone.gpu.device_countis private.
0.0.4 - 2026-11-13¶
Added¶
The execution tape,
vfhe.util.trace: while a trace is enabled, every ring operation the native code makes over an RNS ring leaves an event with its kind, operands, parameters and output, cut into operations by the public calls that made them; it can be bounded, drained by another thread and verified against digests of its values. Thevfhe.vfhepackage reads it:computationturns a trace into the steps of a homomorphic computation (multiplications with their tensor products, key switches and digits, rescales, plaintext-linear steps),witnessapplies an arithmetization and checks every bound and relation on the recorded values, andcccfgs26is the arithmetization of [CCCFGS26, App. A.5].Native multithreading under one library-wide limit,
vfhe.util.parallel:set_num_threads,num_threadsandlocal_num_threads, defaulting toVFHE_NUM_THREADSor 1. Key switches, automorphisms, products, rescales, domain conversions, key generation, the proof-side kernels and every batch call run on those threads, with results independent of their number.Batch calls that do many operations in one native call:
sample_batch,encrypt_batch,encode_batch,multiply_batch,relinearize_batch,round_division_batch,rescale_batch,rational_rescale_batch,automorphism_batch,automorphism_sum,CMUX_batch,functional_bootstrap_batchandencrypt_constants.A memory pool,
vfhe.util.memory_pool, keeping the buffers the library releases for the next request of the same size, bounded byset_capacity("auto", bytes or0), withrelease_all,statisticsandset_wipe_on_release;VFHE_MEMPOOL_CAPACITYandVFHE_MEMPOOL_WIPE_ON_RELEASEset the defaults.Serialization,
vfhe.util.io:Encoder,DecoderandCodec, the plain-value codecs and combinators, and codecs for rings, polynomials, MLWE, MGSW, CKKS and BFV schemes, samples, keys and key-switch keys,CKKS_LinearTransformand the bootstrapping keys, streaming a key one sample at a time with a fresh sample written as its mask seed. The format is a length-prefixed protobuf message per object, with schemas underproto/.vfhe.util.kernels: compile your own C kernels into the library as one link-time-optimised engine,kernels.ExtensionBuilder(sources, declarations).build(), cached under~/.cache/vfhe; thekernelsextra pulls in meson and ninja, and wheels ship the library’s C sources for it.fhe.BFV_Scheme: BFV overvfhe.mlwewith batched encoding, plaintext and ciphertext multiplication, rotation, conjugation and modulus switching.Bootstrapping: the SHIP bootstrap [CHKS25] (
fhe.SHIP), a native CGGI16 blind rotation with an optionally unfolded loop, and the GP25 rework described under Changed.fhe.CKKS_LinearTransform: a slot matrix by its diagonals applied by baby-step giant-step with hoisted rotations, withslot_to_coeffandcoeff_to_slot.CKKS_Scheme:encode(ring=, scale=)also from a complex buffer in place, sparse packing of fewer thanN/2values,multiply_plain,linear_combination(s),conjugate,rotation_generator,product, anddecrypt(message_bound=, drop=)over the fewest primes that hold the plaintext.MLWE_Scheme: hoisted automorphisms (automorphisms,automorphism_sum,automorphism_muxof [CHKS25]),linear_combination(s)withPlaintextMatrixor anIntegerMatrix,trace_pack[CDKS21, LY26],normalized_trace[AP13], ring switching [GHPS12], LWE extraction and the packing key switch,key_gen(distribution="ternary"),gen_ksk(..., hybrid=False),multiply_by_monomial,from_components,mod_reduce,level_with_primes, andlinear_decryptof an extended product.MGSW internal products, automorphisms and noiseless encryptions (
MGSW.internal_product,MGSW_Scheme.automorphism,trivial), andmgsw_shift_sequencesin C.Lookup and range arguments in
vfhe.piop:Relation_LookupwithLookupandLogUpGKR[Hab22, PH23] (the default),Relation_RangewithRangeDecomposition(max_digit_bits)andRelation_ResidueRangewithResidueRangeDecomposition, the range PIOP of [CCCFGS26] over packedR_qpolynomials and over residue oracles;modules/piop/range.mdis the design note.vfhe.piopcomposition: indexed relations, sequential composition (compose, statement heads,Relation_SumDef, GKR as a composition), AND-composition (IOP.and_composition,IOP.batched_call), bundle protocols (Protocol.bundle_key), oracles over their own domain (Oracle.domain), several commitment schemes in one IOP,ClosedFormOracle,VirtualOracle.partial_evaluation, and oracles sent as messages (OracleMessages,BasefoldMessages).Basefold: batched openings of several claims on any of a scheme’s commitments, layer schedules,
BatchFoldEvaloverR_qthrough CRT components [CCCFGS26, §7], the parameter estimatorbasefold_parameters,relative_distance(security_bits)andfoldable_relative_distancewith the"cccfgs26"bound, the general foldable code’sinstantiation,seed,twist_fieldandroot_field,truncated,residue_code, batch encoding and folding, and fibers of adjacent symbols.Native kernels on fields and vectors:
Field.lagrange_interpolate,FieldVector.reindex, thefold_*inner products and product sums,fold_twisted,lift_twisted,fma_interleave, prime-subfield tables,set_uint64,to_uint64,set_radix_decomposition,coefficients,sample_random_at,digest_elements,digest, nativeinverse,pmf_inverse,histogram,count_occurrences,crt_lift_mod_2_128andExtensionFieldNTT.pack(zero_padding=, layout=).Rings:
IntegerMatrixwithinteger_linear_combinations,RNSScalar, CRT components (crt_components,from_crt_components,residue_field,crt_linear_combination,from_diagonal),lift_mod_2_128,to_uint64andfrom_uint64on polynomials and tables,convert_base,rescale_to_power_of_two,gen_primes_near,Ring.digest,MLE.linear_combination,digest_sequence, and the generic operationsdecompose_digit,round_division_approximate,scaled_liftandscale_subto.Native sumcheck rounds for products of any number of ring tables.
Merkle.open_manyandverify_many,polycom.LayerAnswers,vfhe.crypto.join_digests,MerklePath.from_bytes,chain_digestandDigestChain, seeded exceptional samplers (random_exceptional(seed=)),entropy.below_many, seed expansion by AES-128 in counter mode andprng_normal_seededin C.Value equality of rings and schemes by their parameters.
Per-module benchmarks,
make bench, withtools/bench/compare.py; a documentation site,make docs, published to GitHub Pages; Python 3.15; anddocs/USAGE.mdon threads, processes and memory.
Changed¶
BREAKING (proof format): Fiat-Shamir proofs change. The chain is seeded with the root statement’s digest and the registry digest, so a proof is bound to the verifier’s configuration; every value a transcript absorbs has a
digest()method; answers of an opening are layer-major (LayerAnswers); field tables sent as messages travel as vectors; ring challenges are drawn exactly uniformly from an exceptional set whose points are one element in every slot; and the general foldable code of [ZCF24, Def. 5] is the default (instantiation="rs"is the previous one), with twists in the residue fields on a split ring and the base transform’s root inF_p.BREAKING:
vfhe.piopis restructured: the framework is one file per concern and is whatvfhe.piopexports, relations arevfhe.piop.relations, protocolsvfhe.piop.protocols, with nothing re-exported. A statement names oracles, never tables (TableOracle,CommittedOracle,ImplicitOracle);Verifier.challengeandchallenge_bitsare coroutines;Relation_Circuitis an indexed relation andGKRa composed protocol;Relation_Range(bound)takes the bound alone andRangeDecompositionthe digit parameters.BREAKING:
vfhe.utilholds the tooling:vfhe.engineisvfhe.util.bindings(ffiandlibalone), the catalogue isvfhe.util._engine,vfhe.util.kernelsreplacesvfhe.dynamic_extensions, the kernels command ispython -m vfhe.util.kernels, andpython -m vfhe.infoprints JSON.BREAKING: Gadget parameters are one object,
GadgetParams(log_base, digits, primes_per_digit), replacingradix_log_baseeverywhere, with grouped RNS digits (thednumof [HK20]) and approximate decomposition; digits are balanced by default; the division by the special primes is the ModDown of hybrid key switching. Outputs change; what they decrypt to does not.BREAKING: Fresh samples and keys are drawn from seeds, kept as
MLWE.seed, whichvfhe.util.iostores in place of the mask; keys are left in the NTT domain. Distributions are unchanged.BREAKING:
MLWE_Scheme(ring, special_primes=k)derives every level down to one prime by default;phaseislinear_decrypt; prime selection follows the ring’s splitting (a partially split ring takes primes with an odd multiplier,gen_primetakessplit_degree);Ring(mask=)andquotient_ring(mask=)raise for primes outside their pool.BREAKING: GP25 [GP25] is reworked:
GP25(scheme, gsw_ell, gadget_params, bits_per_layer)bootstraps samples of anynandNbetween an input key, a sparse key switched to by a Hamming-weight-reducing key, and an output key, with repacking throughtrace_packand a ring switch;bits_per_layer=2is the multi-bit rotation of [LWZ+26].BREAKING: The CKKS encoder runs on a negacyclic FFT kernel;
ComplexRing(N)takes nospecial_rous, and building a scheme at N = 2^16 takes milliseconds.BREAKING (C):
engine.hisx86_64.h;util.hisalloc.hwith the index and modulus helpers moved toarith.h; cffi declaration files are.h;polynomial_RNS_get_naturalandset_naturaltake the row order;mlwe_full_packing_keyswitchtakes nolvl;-Dfuzz=<engine>replaces two build options. Engines are built with link-time optimisation.BREAKING:
Merkle.from_digestsreads its buffer once and keeps no reference;commit(digests)recommits.Faster:
Lookupbundles claims of one table into one argument; batched openings touch only the block a 0/1-suffixed point selects; the ring’sget_polynomial,get_coeff_matrixandfrom_coeff_matrix, CKKSdecodeanddecrypt, field vector inversion,expand_table, the general code’s encode and lifts, andExtensionFieldNTT.packare one native pass or several times faster; large allocations ask for huge pages;RNSRingequality returns at once for one object.The version is a static line in
pyproject.toml; ruff and pyright are configured in their own files;setuptoolsis no longer a runtime dependency; every copyright header readsThe vfhe authors.The library is written
vfheeverywhere, in prose as in code, as its authors voted;vfheis gone from the documentation, the metadata and the copyright line.
Removed¶
BREAKING: Python 3.10, past its end of life.
BREAKING:
vfhe.dynamic_extensionsand the hot swap,rebind_state, the standalone C library (libvfhe_<engine>shared and static libraries, pkg-config files, installed headers,engine-<engine>.json),vfhe_engine_activeand the C CPU probe,libvfhe/LibVFHE,active_engine,runnable_enginesandcache_root.BREAKING:
ImplicitOracle,ImplicitEvaland theimplicitregistry entry: an oracle defined by a sum is aRelation_SumDefstatement.BREAKING:
ComplexRing’s special-root transforms andmpmath;array_reduce_mod_Nandarray_mod_switch_from_2k;phaseand its native forms;full_packing_keyswitch_scaled; the unimplemented LWE key switch; GP25’s previous surface (sab_rlwe_bootstrap,encrypt_bits,generate_sparse_ternary_keyand the rest, see the rework); andCGGI16_Key.b_prec.
Fixed¶
Uniform sampling below a prime was biased: masks, keys and
sample_uniformnow draw by rejection and are exactly uniform.MLWE_Scheme(ring, special_primes=n)dropped the special primes for every ring but the first over its base, so key switching ran BV with a prime’s worth of extra noise;special_primes >= 2and one-prime rings raised.MGSW keys of a level whose primes do not come first in the ring gave garbage from every external product and CMUX;
external_productandCMUXreturned level-0 samples whatever the input’s level.MLWE_Scheme.sampleat a level sharing no prime with level 0 did not decrypt;mlwe_round_divisionleft a sample on its old ring;MLWE.new_likelost the ring, rank or extension of its input;ct + pandct - preturned an uninitialized mask;CKKS_Scheme.multiplyreturned the wrongdelta.CKKS encoding at a scale reaching 2^63 wrapped silently and now reduces exactly; a non-finite value raises
ValueError;ComplexRing(N)crashed forN < 8on avx512ifma.to_uint64andfrom_uint64on a ring listing its primes out of the base’s order permuted the rows, so range proofs rejected honest claims;from_coeff_matrixread past a short row;from_bigint_arraywith fewer thanNvalues read heap contents; the product of a polynomial by a large or numpy integer raised.The entropy stream served several threads the same bytes and a forked child its parent’s; a forked child could hang on its first ring lookup; native ring handles stopped being shared after 256 rings.
Multiprecision reconstruction crashed with a second ring, paired constants with the wrong primes, returned unreduced values and leaked;
ExtensionFieldaccepted a composite modulus;FieldVector.viewof a view read the wrong elements;field_vec_invwrote before finding a zero.Basefold.commitwith a prover kept every proof’s opening on the scheme;BasefoldEval,RangeDecompositionandLookupdrew challenges in the IOP’s domain instead of their own;Lookupraised on tables of fewer than eight entries;Division.remainderwas wrong when the divisor exceeded the quotient’s modulus, andcccfgs26rejected honest computations.Ring(N, prime_size=[...])searched forever when no prime of a size was left, andRing(N, primes=[...])failed withoutprime_size=None.The documented meaning of
deltainsoundness_errorand the contract ofbase_extendwere corrected; behaviour is unchanged.
Security¶
A failing entropy source (RDRAND,
/dev/urandom) exits the process with the reason on stderr; it used to print to stdout and return an undefined seed.A Gaussian draw whose uniform word was zero produced an infinite sample and an undefined integer cast, once in 2^64 draws; the words now map into the open unit interval.
normal_from_seedis a new mapping from seed to samples, under a new derive-key context.The portable seed source reads
getentropyin place of/dev/urandomthrough stdio, which over-read the device into a buffer that kept the bytes; RDRAND retries a drained step ten times before failing, Intel’s guidance, where one miss used to exit. The fresh seed, the AES round keys and the served slice of the per-thread pool are wiped once used.seeded.below’s mask is built frombound - 1, as documented: a power- of-two bound no longer rejects half its draws. The sequence changes for those bounds alone. Acontextwith a NUL byte and a bound past 64 bits raiseValueError; BLAKE3 would have cut the context short.
0.0.3 - 2026-09-10¶
Added¶
Add engine selection at import. An install carries one extension per instruction-set level its architecture supports (
portable,avx512ifma,neon) and loads the best one this CPU can run, asking a separate probe extension so choosing an engine never loads one.VFHE_ENGINE=<name>pins the choice and refuses a CPU that cannot run it, andvfhe_engine_active()reports it.Add wheels for manylinux x86_64/aarch64 and macOS arm64, published alongside the sdist with the same provenance attestation, so most installs need no compiler.
Add arm64 Linux to the tested platforms.
Add
python -m vfhe.info, which prints the version, the selected engine, anything faster this CPU could have run, and the platform — the whole environment a bug report needs.Add PEP 561 typing markers to every subpackage, so a type checker resolves
vfhe.*against an install.Add
vfhe.crypto.entropyandvfhe.crypto.seeded, a typed Python surface over the C generators: unpredictable bytes, values below a bound, Gaussian draws, and the seeded(context, seed)sampler a transcript recomputes, plusentropy.deterministic(seed)for tests. They are the library’s only randomness — nothing in the tree draws fromsecrets,random, or the OS directly any more.Add the metadata a scanner and a redistributor need to every wheel:
CycloneDX SBOM fragments at
.dist-info/sboms/, the location PEP 770 standardises — the vendored BLAKE3 sources, plus pedigree entries for code adapted from MOSFHET, Intel HEXL, and a modular-inverse routine whose upstream licence is unstated. A metadata scan cannot see C compiled into an extension, and install tools copy that directory, so a scanner reading an installed wheel can.The Apache-2.0 licence text and
NOTICEat.dist-info/licenses/, so a redistributor receives the attribution the licence requires for the C vfhe ships.
Changed¶
BREAKING: Move the multilinear-extension layer from
vfhe.pioptovfhe.arithand the Merkle tree fromvfhe.pioptovfhe.crypto, which is now a Python-facing module. ImportMLE,SparseMLE,MLE_BasisandMLE_Variablefromvfhe.arith, andMerkle/MerklePathfromvfhe.crypto;vfhe.piopno longer re-exports them. Neither depended on anything PIOP-specific.BREAKING: Split
vfhe.miscintovfhe.engine(the native handle) andvfhe.dynamic_extensions(runtime C compilation), and move randomness into a new internalcryptomodule. Importfrom vfhe.engine import ffi, libin place ofvfhe.misc.libvfhe, andvfhe.dynamic_extensionsin place ofvfhe.misc.dynamic_extensions.Change
vfhe.dynamic_extensionsto compile only your files and link them against the shippedlibvfhe_<engine>.a, rather than rebuilding the whole library from source. A runtime compile drops from the full kernel set to your snippet, and an install no longer carries C sources or build machinery.Change the build backend to meson (
meson-python).setup.pyandMANIFEST.inare gone, and an sdist vendors the BLAKE3 sources with a frozen version, so building one needs neither git nor submodules.Verify a release’s provenance after publishing as well as before: every file the index serves is downloaded and checked against the one workflow allowed to have signed it.
Change the security contact to security@vfhe.ai and the conduct contact to conduct@vfhe.ai.
Removed¶
BREAKING: Remove the
VFHE_PORTABLEandVFHE_TUNEDbuild knobs. Every build now carries every engine its architecture supports and picks one at import.Remove the CycloneDX SBOM asset from releases. It described one CI runner’s dependency resolution, which no user reproduces; the vendored-C record it uniquely held now ships inside every wheel.
Fixed¶
Fix a crash in the AES-NI/VAES keystream when asked for 256 bytes or more into a buffer that is not 64-byte aligned: it wrote through aligned vector stores while its callers’ signatures promised a plain
uint8_t *. Every in-tree caller happened to pass aligned memory, so it only surfaced once the generators were reachable from Python.Fix
vfhe.dynamic_extensions:It failed from an installed package, because the C sources it recompiles were never installed and a clean Python 3.12 or later lacks the setuptools cffi compiles through. Installs now ship the build inputs as
vfhe/_source.User-supplied compiler and linker flags replaced the build plan’s instead of extending them, reinitialization failures degraded to warnings, repeated compiles accumulated
sys.pathentries, andXDG_CACHE_HOMEwas ignored.
Fix an async multilinear-polynomial evaluation being collected mid-flight, because the event loop holds tasks only weakly and the spawned task was never referenced.
Fix the generated protobuf bindings:
import vfhe.circuitraisedVersionErroron protobuf 6.x, which the declared floor allowed, because the bindings are generated against 7.35.1 and protobuf refuses a runtime older than its gencode. The floor now states what they need (protobuf>=7.35.1,<8).They installed as implicit namespace packages, so another distribution shipping a
_vfhe_protodirectory would have merged into the same namespace instead of conflicting.
0.0.2 - 2026-07-22¶
Added¶
Add
AUTHORS.md,SECURITY.md,CONTRIBUTING.md,CODE_OF_CONDUCT.md, and this changelog.Add Python 3.14 support, tested in CI and declared in the classifiers.
Add coverage reporting for Python and C, informational only.
Add nightly and per-pull-request fuzzing (ClusterFuzzLite).
Attach a CycloneDX SBOM and Sigstore build provenance to each GitHub Release (verifiable with
gh attestation verify), and publish to PyPI via Trusted Publishing.
Changed¶
Move the development guide from the README to
docs/DEVELOPMENT.md. The README now targets users and renders cleanly on PyPI.Rework CI end to end: parallel required checks behind one gate, SHA-pinned actions, hardened permissions, and an sdist install-and-smoke check.
Raise the minimum
cffito 2.1 at runtime andsetuptools-scmto 10.2 at build time.
Fixed¶
Fix
ntt_new_proclooping forever searching for a primitive root of unity with certain prime and ring-size combinations. The search is now deterministic and always terminates.Fix a module compiled at runtime auto-tuning independently of the loaded engine, so a portable process could load AVX-512 kernels and crash. A custom build now inherits the loaded engine’s mode.
0.0.1 - 2026-07-08¶
Added¶
Publish the initial pre-release on PyPI: RNS polynomial arithmetic with incomplete NTTs (
arith), LWE / Module-LWE and MGSW (mlwe), CKKS with CGGI16 and GP25 bootstrapping (fhe), layered GKR circuits (circuit), and an AVX-512 or portable native engine.Distribute as an sdist, which builds against the host CPU at install time.