By selecting a particular MATHBACKEND, we are choosing a default implementation for:
BigIntegerBigVectorPoly and ciphertext modulus used in DCRTPolyFor native arithmetic, NativeInteger and NativeVector is available.
All implementations for Big/Native Integer/Vector are based on integer.h.
Goal: Support choosing, at run-time, which math backend to use.
Currently: Compile-time choice of which backend to use
You can do either:
CMAKE process:cmake -DMATHBACKEND=4 ..src/core/math/hal/bigintbackend.h (and comment out the rest)BigInteger will be BitIntegerBitLength (defined in `backend.h) which has a default of 3000 bits.BigIntegerBitLength larger than double the bitwidth of the largest (
ciphertext) modulus.This parameter can be decreased for runtime/space optimization when the largest modulus is under 1500 bits.
Note: The underlying implementation is fixed-size array of native ints.
typedef using integral_dtype and MUST be uint32_t; using other types
is an open work itemBigIntegerUBINT_32 is defined as is in ubintdyn.hUBINT_64 is not supported. It is however a open work item.NTL library with OpenFHENTL or GMP is enabled using CMAKEThis is an integration of the NTL library with OpenFHE, and is only available when NTL/GMP is enabled using CMAKE.
We use the following naming conventions:
ModMul(b, mod)
ModMul(b, mod, mu)
mu for Barrett modulo can be precomputed by mod.ComputeMu().ModMulFast(b, mod)
ModMulFast(b, mod, mu)
ModMulFastConst(b, mod, bPrecomp)
bPrecomp can be precomputed by b.PrepModMulConst(mod).| Variant | Naive | Barrett | Fast Naive | Fast Barrett | Fast Const | |---------|----------------|--------------------|--------------------|------------------------|-----------------------------------| | Mod | Mod(mod) | Mod(mod, mu) | - | - | - | | ModAdd | ModAdd(b, mod) | ModAdd(b, mod, mu) | ModAddFast(b, mod) | - | - | | ModSub | ModSub(b, mod) | ModSub(b, mod, mu) | ModSubFast(b, mod) | - | - | | ModMul | ModMul(b, mod) | ModMul(b, mod, mu) | ModMulFast(b, mod) | ModMulFast(b, mod, mu) | ModMulFastConst(b, mod, bPrecomp) |
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.