Template Class ChineseRemainderTransformArbNat

Inheritance Relationships

Base Type

Template Parameter Order

  1. typename VecType

Class Documentation

template<typename VecType>
class intnat::ChineseRemainderTransformArbNat : public lbcrypto::ChineseRemainderTransformArbInterface<VecType>

Inheritence diagram for intnat::ChineseRemainderTransformArbNat:

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

Collaboration diagram for intnat::ChineseRemainderTransformArbNat:

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

Chinese Remainder Transform for arbitrary cyclotomics.

Public Functions

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

Sets the cyclotomic polynomial.

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

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)

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

Reset cached values for the transform to empty.

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

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)

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)

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)

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.