Template Class ChineseRemainderTransformFTTInterface

Inheritance Relationships

Derived Type

Template Parameter Order

  1. typename VecType

Class Documentation

template<typename VecType>
class lbcrypto::ChineseRemainderTransformFTTInterface

Inheritence diagram for lbcrypto::ChineseRemainderTransformFTTInterface:

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

Golden Chinese Remainder Transform FFT implementation.

Subclassed by intnat::ChineseRemainderTransformFTTNat< VecType >

Public Functions

virtual void ForwardTransformToBitReverse(const VecType &element, const IntType &rootOfUnity, const usint CycloOrder, VecType *result) = 0

Copies element into result and calls NumberTheoreticTransform::ForwardTransformToBitReverseInPlace()

Forward Transform in the ring Z_q[X]/(X^n+1) with prime q and power-of-two n s.t. 2n|q-1. Bit reversing indexes.

See also

NumberTheoreticTransform::ForwardTransformToBitReverseInPlace()

Parameters
  • &element[in] is the input to the transform of type VecType and length n.

  • &rootOfUnity – is the 2n-th root of unity in Z_q. Used to precompute the root of unity tables if needed. If rootOfUnity == 0 or 1, then the result == input.

  • CycloOrder – is 2n, should be a power-of-two or a throw if an error occurs.

  • *result[out] is the result of the transform, a VecType should be of the same size as input or a throw of error occurs.

virtual void ForwardTransformToBitReverseInPlace(const IntType &rootOfUnity, const usint CycloOrder, VecType *element) = 0

In-place Forward Transform in the ring Z_q[X]/(X^n+1) with prime q and power-of-two n s.t. 2n|q-1. Bit reversing indexes.

See also

NumberTheoreticTransform::ForwardTransformToBitReverseInPlace()

Parameters
  • &rootOfUnity – is the 2n-th root of unity in Z_q. Used to precompute the root of unity tables if needed. If rootOfUnity == 0 or 1, then the result == input.

  • CycloOrder – is 2n, should be a power-of-two or a throw if an error occurs.

  • &element[inout] is the input to the transform of type VecType and length n.

Returns

none

virtual void InverseTransformFromBitReverse(const VecType &element, const IntType &rootOfUnity, const usint CycloOrder, VecType *result) = 0

Copies element into result and calls NumberTheoreticTransform::InverseTransformFromBitReverseInPlace()

Inverse Transform in the ring Z_q[X]/(X^n+1) with prime q and power-of-two n s.t. 2n|q-1. Bit reversing indexes.

See also

NumberTheoreticTransform::InverseTransformFromBitReverseInPlace()

Parameters
  • &element[in] – is the input to the transform of type VecType and length n.

  • &rootOfUnity – is the 2n-th root of unity in Z_q. Used to precompute the root of unity tables if needed. If rootOfUnity == 0 or 1, then the result == input.

  • CycloOrder – is 2n, should be a power-of-two or a throw if an error occurs.

  • *result[out] is the result of the transform, a VecType should be of the same size as input or a throw if an error occurs.

Returns

none

virtual void InverseTransformFromBitReverseInPlace(const IntType &rootOfUnity, const usint CycloOrder, VecType *element) = 0

In-place Inverse Transform in the ring Z_q[X]/(X^n+1) with prime q and power-of-two n s.t. 2n|q-1. Bit reversing indexes.

See also

NumberTheoreticTransform::InverseTransformFromBitReverseInPlace()

Parameters
  • &rootOfUnity – is the 2n-th root of unity in Z_q. Used to precompute the root of unity tables if needed. If rootOfUnity == 0 or 1, then the result == input.

  • CycloOrder – is 2n, should be a power-of-two or a throw if an error occurs.

  • &element[inout] is the input/output of the transform of type VecType and length n.

Returns

none

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

Precomputation of root of unity tables for transforms in the ring Z_q[X]/(X^n+1)

Parameters
  • &rootOfUnity – is the 2n-th root of unity in Z_q. Used to precompute the root of unity tables if needed. If rootOfUnity == 0 or 1, then the result == input.

  • CycloOrder – is a power-of-two, equal to 2n.

  • modulus – is q, the prime modulus

virtual void PreCompute(std::vector<IntType> &rootOfUnity, const usint CycloOrder, std::vector<IntType> &moduliChain) = 0

Precomputation of root of unity tables for transforms in the ring Z_q[X]/(X^n+1)

Parameters
  • &rootOfUnity – is the 2n-th root of unity in Z_q. Used to precompute the root of unity tables if needed. If rootOfUnity == 0 or 1, then the result == input.

  • CycloOrder – is a power-of-two, equal to 2n.

  • &moduliChain – is the vector of prime moduli qi such that 2n|qi-1

virtual void Reset() = 0

Reset cached values for the root of unity tables to empty.