Template Class ChineseRemainderTransformArbInterface

Inheritance Relationships

Derived Type

Template Parameter Order

  1. typename VecType

Class Documentation

template<typename VecType>
class lbcrypto::ChineseRemainderTransformArbInterface

Inheritence diagram for lbcrypto::ChineseRemainderTransformArbInterface:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "1" [label="lbcrypto::ChineseRemainderTransformArbInterface< VecType >" tooltip="lbcrypto::ChineseRemainderTransformArbInterface< VecType >" fillcolor="#BFBFBF"] "2" [label="intnat::ChineseRemainderTransformArbNat< VecType >" tooltip="intnat::ChineseRemainderTransformArbNat< VecType >"] "2" -> "1" [dir=forward tooltip="public-inheritance"] }

Chinese Remainder Transform for arbitrary cyclotomics.

Subclassed by intnat::ChineseRemainderTransformArbNat< VecType >

Public Functions

virtual void SetCylotomicPolynomial(const VecType &poly, const IntType &mod) = 0

Sets the cyclotomic polynomial.

virtual VecType ForwardTransform(const VecType &element, const IntType &root, const IntType &bigMod, const IntType &bigRoot, const usint cycloOrder) = 0

Forward transform.

Parameters
  • element – is the element to perform the transform on.

  • root – is the 2mth root of unity w.r.t the ring modulus.

  • cycloOrder – is the cyclotomic order of the ring element.

  • bigMod – is the addtional modulus needed for NTT operation.

  • bigRoot – is the addtional root of unity w.r.t bigMod needed for NTT operation.

Returns

is the output result of the transform.

virtual VecType InverseTransform(const VecType &element, const IntType &root, const IntType &bigMod, const IntType &bigRoot, const usint cycloOrder) = 0

Inverse transform.

Parameters
  • element – is the element to perform the transform on.

  • root – is the 2mth root of unity w.r.t the ring modulus.

  • cycloOrder – is the cyclotomic order of the ring element.

  • bigMod – is the addtional modulus needed for NTT operation.

  • bigRoot – is the addtional root of unity w.r.t bigMod needed for NTT operation.

Returns

is the output result of the transform.

virtual void Reset() = 0

Reset cached values for the transform to empty.

virtual void PreCompute(const usint cyclotoOrder, const IntType &modulus) = 0

Precomputes the root of unity and modulus needed for NTT operation in forward Bluestein transform.

Parameters
  • cycloOrder – is the cyclotomic order of the polynomial ring.

  • modulus – is the modulus of the polynomial ring.

virtual void SetPreComputedNTTModulus(usint cyclotoOrder, const IntType &modulus, const IntType &nttMod, const IntType &nttRoot) = 0

Sets the precomputed root of unity and modulus needed for NTT operation in forward Bluestein transform.

Parameters
  • cycloOrder – is the cyclotomic order of the polynomial ring.

  • modulus – is the modulus of the polynomial ring.

  • nttMod – is the modulus needed for the NTT operation in forward Bluestein transform.

  • nttRoot – is the root of unity needed for the NTT operation in forward Bluestein transform.

virtual void SetPreComputedNTTDivisionModulus(usint cyclotoOrder, const IntType &modulus, const IntType &nttMod, const IntType &nttRoot) = 0

Sets the precomputed root of unity and modulus needed for NTT operation and computes m_cyclotomicPolyReveseNTTMap,m_cyclotomicPolyNTTMap. Always called after setting the cyclotomic polynomial.

Parameters
  • cycloOrder – is the cyclotomic order of the polynomial ring.

  • modulus – is the modulus of the polynomial ring.

  • nttMod – is the modulus needed for the NTT operation in forward Bluestein transform.

  • nttRoot – is the root of unity needed for the NTT operation in forward Bluestein transform.

virtual VecType InversePolyMod(const VecType &cycloPoly, const IntType &modulus, usint power) = 0

Computes the inverse of the cyclotomic polynomial using Newton-Iteration method.

Parameters
  • cycloPoly – is the cyclotomic polynomial.

  • modulus – is the modulus of the polynomial ring.

Returns

inverse polynomial.