inst/openfhe/src/core/include/math/math_backends.md

Math Backends

Design

Goal: Support choosing, at run-time, which math backend to use.

Currently: Compile-time choice of which backend to use

Choosing a Backend

You can do either:

Math Backend Descriptions

MATHBACKEND 2

MATHBACKEND 4

MATHBACKEND 6

This is an integration of the NTL library with OpenFHE, and is only available when NTL/GMP is enabled using CMAKE.

Supported Math Operations

Modular Multiplication

We use the following naming conventions:

Other Modular Operations

| 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) |



Try the openfhe.R package in your browser

Any scripts or data that you put into this service are public.

openfhe.R documentation built on Nov. 13, 2026, 5:07 p.m.