helib::EncryptedArrayDerived< type > Class Template Reference

Derived concrete implementation of EncryptedArrayBase. More...

#include <EncryptedArray.h>

Inheritance diagram for helib::EncryptedArrayDerived< type >:
helib::EncryptedArrayBase

Public Member Functions

 EncryptedArrayDerived (const Context &_context, const RX &_G, const PAlgebraMod &_tab)
 
 EncryptedArrayDerived (const EncryptedArrayDerived &other)
 
EncryptedArrayDerived & operator= (const EncryptedArrayDerived &)=delete
 
virtual EncryptedArrayBase * clone () const override
 
virtual PA_tag getTag () const override
 
template<template< typename > class T, typename... Args>
void dispatch (Args &&... args) const
 
const RX & getG () const
 
const NTL::Mat< R > & getNormalBasisMatrix () const
 
const NTL::Mat< R > & getNormalBasisMatrixInverse () const
 
void initNormalBasisMatrix () const
 
virtual void restoreContext () const override
 
virtual void restoreContextForG () const override
 
virtual const Context & getContext () const override
 
virtual const PAlgebra & getPAlgebra () const override
 
virtual long getDegree () const override
 
const PAlgebraModDerived< type > & getTab () const
 
virtual void rotate (Ctxt &ctxt, long k) const override
 Right rotation as a linear array. E.g., rotating ctxt=Enc(1 2 3 ... n) by k=1 gives Enc(n 1 2 ... n-1) More...
 
virtual void shift (Ctxt &ctxt, long k) const override
 Non-cyclic right shift with zero fill E.g., shifting ctxt=Enc(1 2 3 ... n) by k=1 gives Enc(0 1 2... n-1) More...
 
virtual void rotate1D (Ctxt &ctxt, long i, long k, bool dc=false) const override
 right-rotate k positions along the i'th dimension More...
 
long getP2R () const override
 
template<typename U >
void rotate1D (std::vector< U > &out, const std::vector< U > &in, long i, long offset) const
 
virtual void shift1D (Ctxt &ctxt, long i, long k) const override
 Right shift k positions along the i'th dimension with zero fill. More...
 
void decrypt (UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED std::vector< double > &ptxt, UNUSED OptLong prec=OptLong()) const override
 Unimplemented decrypt function for CKKS. It will always throw helib::LogicError. More...
 
void decrypt (UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED std::vector< cx_double > &ptxt, UNUSED OptLong prec=OptLong()) const override
 Unimplemented decrypt function for CKKS. It will always throw helib::LogicError. More...
 
void rawDecrypt (UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED std::vector< cx_double > &ptxt) const override
 
void rawDecrypt (UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED std::vector< double > &ptxt) const override
 
void rawDecrypt (UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED PlaintextArray &ptxt) const override
 
void decryptComplex (UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED PlaintextArray &ptxt, UNUSED OptLong prec=OptLong()) const override
 
void rawDecryptComplex (UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED PlaintextArray &ptxt) const override
 
void decryptReal (UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED PlaintextArray &ptxt, UNUSED OptLong prec=OptLong()) const override
 
void rawDecryptReal (UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED PlaintextArray &ptxt) const override
 
virtual void encode (NTL::ZZX &ptxt, const std::vector< long > &array) const override
 
virtual void encode (zzX &ptxt, const std::vector< long > &array) const override
 
virtual void encode (NTL::ZZX &ptxt, const std::vector< NTL::ZZX > &array) const override
 
virtual void encode (zzX &ptxt, const std::vector< zzX > &array) const override
 
virtual void encode (NTL::ZZX &ptxt, const PlaintextArray &array) const override
 
virtual void encode (zzX &ptxt, const PlaintextArray &array) const override
 
virtual void encodeUnitSelector (zzX &ptxt, long i) const override
 Encodes a std::vector with 1 at position i and 0 everywhere else. More...
 
virtual void encode (zzX &ptxt, const std::vector< NTL::ZZX > &array) const override
 
virtual void encode (EncodedPtxt &eptxt, const std::vector< NTL::ZZX > &array) const override
 
virtual void encode (EncodedPtxt &eptxt, const std::vector< long > &array) const override
 
virtual void encode (UNUSED EncodedPtxt &eptxt, UNUSED const std::vector< cx_double > &array, UNUSED double mag=-1, UNUSED OptLong prec=OptLong()) const override
 
virtual void encode (UNUSED EncodedPtxt &eptxt, UNUSED const std::vector< double > &array, UNUSED double mag=-1, UNUSED OptLong prec=OptLong()) const override
 
virtual void encode (EncodedPtxt &eptxt, const PlaintextArray &array, double mag=-1, OptLong prec=OptLong()) const override
 
virtual void encode (EncodedPtxt &eptxt, const std::vector< bool > &array) const override
 
virtual void encodeUnitSelector (EncodedPtxt &eptxt, long i) const override
 
virtual void decode (std::vector< long > &array, const NTL::ZZX &ptxt) const override
 
virtual void decode (std::vector< NTL::ZZX > &array, const NTL::ZZX &ptxt) const override
 
virtual void decode (PlaintextArray &array, const NTL::ZZX &ptxt) const override
 
virtual void decode (PlaintextArray &array, const zzX &ptxt) const
 
virtual void random (std::vector< long > &array) const override
 
virtual void random (std::vector< NTL::ZZX > &array) const override
 
virtual void decrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< long > &ptxt) const override
 
virtual void decrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< NTL::ZZX > &ptxt) const override
 
virtual void decrypt (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt, OptLong prec=OptLong()) const override
 
virtual void buildLinPolyCoeffs (std::vector< NTL::ZZX > &C, const std::vector< NTL::ZZX > &L) const override
 Linearized polynomials. L describes a linear map M by describing its action on the standard power basis: M(x^j mod G) = (L[j] mod G), for j = 0..d-1. The result is a coefficient vector C for the linearized polynomial representing M: a polynomial h in Z/(p^r)[X] of degree < d is sent to. More...
 
void encode (zzX &ptxt, const std::vector< RX > &array) const
 
void decode (std::vector< RX > &array, const zzX &ptxt) const
 
void encode (NTL::ZZX &ptxt, const std::vector< RX > &array) const
 
void decode (std::vector< RX > &array, const NTL::ZZX &ptxt) const
 
void encode (RX &ptxt, const std::vector< RX > &array) const
 
void decode (std::vector< RX > &array, const RX &ptxt) const
 
void random (std::vector< RX > &array) const
 
void decrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< RX > &ptxt) const
 
virtual void buildLinPolyCoeffs (std::vector< RX > &C, const std::vector< RX > &L) const
 
- Public Member Functions inherited from helib::EncryptedArrayBase
virtual ~EncryptedArrayBase ()
 
long size () const
 Total size (# of slots) of hypercube. More...
 
long dimension () const
 Number of dimensions of hypercube. More...
 
long sizeOfDimension (long i) const
 Size of given dimension. More...
 
bool nativeDimension (long i) const
 Is rotations in given dimension a "native" operation? More...
 
long coordinate (long i, long k) const
 returns coordinate of index k along the i'th dimension More...
 
long addCoord (long i, long k, long offset) const
 adds offset to index k in the i'th dimension More...
 
template<typename U >
void rotate1D (std::vector< U > &out, const std::vector< U > &in, long i, long offset) const
 rotate an array by offset in the i'th dimension (output should not alias input) More...
 
virtual void encode (EncodedPtxt &eptxt, const std::vector< cx_double > &array, double mag=-1, OptLong prec=OptLong()) const =0
 
virtual void encode (EncodedPtxt &eptxt, const std::vector< double > &array, double mag=-1, OptLong prec=OptLong()) const =0
 
virtual double defaultScale (UNUSED double err, UNUSED OptLong prec=OptLong()) const
 
virtual double defaultErr () const
 
long decode1Slot (const NTL::ZZX &ptxt, long i) const
 
void decode1Slot (NTL::ZZX &slot, const NTL::ZZX &ptxt, long i) const
 
virtual void decrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< double > &ptxt, OptLong prec=OptLong()) const =0
 
virtual void decrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< cx_double > &ptxt, OptLong prec=OptLong()) const =0
 
virtual void rawDecrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< cx_double > &ptxt) const =0
 
virtual void rawDecrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< double > &ptxt) const =0
 
virtual void decryptComplex (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt, OptLong prec=OptLong()) const =0
 
virtual void decryptReal (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt, OptLong prec=OptLong()) const =0
 
virtual void rawDecrypt (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt) const =0
 
virtual void rawDecryptComplex (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt) const =0
 
virtual void rawDecryptReal (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt) const =0
 
long decrypt1Slot (const Ctxt &ctxt, const SecKey &sKey, long i) const
 
void decrypt1Slot (NTL::ZZX &slot, const Ctxt &ctxt, const SecKey &sKey, long i) const
 

Detailed Description

template<typename type>
class helib::EncryptedArrayDerived< type >

Derived concrete implementation of EncryptedArrayBase.

Constructor & Destructor Documentation

◆ EncryptedArrayDerived() [1/2]

template<typename type >
helib::EncryptedArrayDerived< type >::EncryptedArrayDerived ( const Context &  _context,
const RX &  _G,
const PAlgebraMod &  _tab 
)
explicit

◆ EncryptedArrayDerived() [2/2]

template<typename type >
helib::EncryptedArrayDerived< type >::EncryptedArrayDerived ( const EncryptedArrayDerived< type > &  other)
inline

Member Function Documentation

◆ buildLinPolyCoeffs() [1/2]

template<typename type >
void helib::EncryptedArrayDerived< type >::buildLinPolyCoeffs ( std::vector< NTL::ZZX > &  C,
const std::vector< NTL::ZZX > &  L 
) const
overridevirtual

Linearized polynomials. L describes a linear map M by describing its action on the standard power basis: M(x^j mod G) = (L[j] mod G), for j = 0..d-1. The result is a coefficient vector C for the linearized polynomial representing M: a polynomial h in Z/(p^r)[X] of degree < d is sent to.

\[ M(h(X) \bmod G)= \sum_{j=0}^{d-1}(C[j] \cdot h(X^{p^j}))\bmod G). \]

Implements helib::EncryptedArrayBase.

◆ buildLinPolyCoeffs() [2/2]

template<typename type >
void helib::EncryptedArrayDerived< type >::buildLinPolyCoeffs ( std::vector< RX > &  C,
const std::vector< RX > &  L 
) const
virtual

◆ clone()

template<typename type >
virtual EncryptedArrayBase* helib::EncryptedArrayDerived< type >::clone ( ) const
inlineoverridevirtual

◆ decode() [1/7]

template<typename type >
void helib::EncryptedArrayDerived< type >::decode ( PlaintextArray &  array,
const NTL::ZZX &  ptxt 
) const
overridevirtual

◆ decode() [2/7]

template<typename type >
void helib::EncryptedArrayDerived< type >::decode ( PlaintextArray &  array,
const zzX &  ptxt 
) const
virtual

◆ decode() [3/7]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::decode ( std::vector< long > &  array,
const NTL::ZZX &  ptxt 
) const
inlineoverridevirtual

◆ decode() [4/7]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::decode ( std::vector< NTL::ZZX > &  array,
const NTL::ZZX &  ptxt 
) const
inlineoverridevirtual

◆ decode() [5/7]

template<typename type >
void helib::EncryptedArrayDerived< type >::decode ( std::vector< RX > &  array,
const NTL::ZZX &  ptxt 
) const

◆ decode() [6/7]

template<typename type >
void helib::EncryptedArrayDerived< type >::decode ( std::vector< RX > &  array,
const RX &  ptxt 
) const

◆ decode() [7/7]

template<typename type >
void helib::EncryptedArrayDerived< type >::decode ( std::vector< RX > &  array,
const zzX &  ptxt 
) const

◆ decrypt() [1/6]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::decrypt ( const Ctxt &  ctxt,
const SecKey &  sKey,
PlaintextArray &  ptxt,
OptLong  prec = OptLong() 
) const
inlineoverridevirtual

◆ decrypt() [2/6]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::decrypt ( const Ctxt &  ctxt,
const SecKey &  sKey,
std::vector< long > &  ptxt 
) const
inlineoverridevirtual

◆ decrypt() [3/6]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::decrypt ( const Ctxt &  ctxt,
const SecKey &  sKey,
std::vector< NTL::ZZX > &  ptxt 
) const
inlineoverridevirtual

◆ decrypt() [4/6]

template<typename type >
void helib::EncryptedArrayDerived< type >::decrypt ( const Ctxt &  ctxt,
const SecKey &  sKey,
std::vector< RX > &  ptxt 
) const
inline

◆ decrypt() [5/6]

template<typename type >
void helib::EncryptedArrayDerived< type >::decrypt ( UNUSED const Ctxt &  ctxt,
UNUSED const SecKey &  sKey,
UNUSED std::vector< cx_double > &  ptxt,
UNUSED OptLong  prec = OptLong() 
) const
inlineoverride

Unimplemented decrypt function for CKKS. It will always throw helib::LogicError.

Parameters
ctxtUnused.
sKeyUnused.
ptxtUnused.
precUnused.

◆ decrypt() [6/6]

template<typename type >
void helib::EncryptedArrayDerived< type >::decrypt ( UNUSED const Ctxt &  ctxt,
UNUSED const SecKey &  sKey,
UNUSED std::vector< double > &  ptxt,
UNUSED OptLong  prec = OptLong() 
) const
inlineoverride

Unimplemented decrypt function for CKKS. It will always throw helib::LogicError.

Parameters
ctxtUnused.
sKeyUnused.
ptxtUnused.
precUnused.

◆ decryptComplex()

template<typename type >
void helib::EncryptedArrayDerived< type >::decryptComplex ( UNUSED const Ctxt &  ctxt,
UNUSED const SecKey &  sKey,
UNUSED PlaintextArray &  ptxt,
UNUSED OptLong  prec = OptLong() 
) const
inlineoverride

◆ decryptReal()

template<typename type >
void helib::EncryptedArrayDerived< type >::decryptReal ( UNUSED const Ctxt &  ctxt,
UNUSED const SecKey &  sKey,
UNUSED PlaintextArray &  ptxt,
UNUSED OptLong  prec = OptLong() 
) const
inlineoverride

◆ dispatch()

template<typename type >
template<template< typename > class T, typename... Args>
void helib::EncryptedArrayDerived< type >::dispatch ( Args &&...  args) const
inline

◆ encode() [1/16]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::encode ( EncodedPtxt &  eptxt,
const PlaintextArray &  array,
double  mag = -1,
OptLong  prec = OptLong() 
) const
inlineoverridevirtual

◆ encode() [2/16]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::encode ( EncodedPtxt &  eptxt,
const std::vector< bool > &  array 
) const
inlineoverridevirtual

◆ encode() [3/16]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::encode ( EncodedPtxt &  eptxt,
const std::vector< long > &  array 
) const
inlineoverridevirtual

◆ encode() [4/16]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::encode ( EncodedPtxt &  eptxt,
const std::vector< NTL::ZZX > &  array 
) const
inlineoverridevirtual

◆ encode() [5/16]

template<typename type >
void helib::EncryptedArrayDerived< type >::encode ( NTL::ZZX &  ptxt,
const PlaintextArray &  array 
) const
overridevirtual

◆ encode() [6/16]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::encode ( NTL::ZZX &  ptxt,
const std::vector< long > &  array 
) const
inlineoverridevirtual

◆ encode() [7/16]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::encode ( NTL::ZZX &  ptxt,
const std::vector< NTL::ZZX > &  array 
) const
inlineoverridevirtual

◆ encode() [8/16]

template<typename type >
void helib::EncryptedArrayDerived< type >::encode ( NTL::ZZX &  ptxt,
const std::vector< RX > &  array 
) const

◆ encode() [9/16]

template<typename type >
void helib::EncryptedArrayDerived< type >::encode ( RX &  ptxt,
const std::vector< RX > &  array 
) const

◆ encode() [10/16]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::encode ( UNUSED EncodedPtxt &  eptxt,
UNUSED const std::vector< cx_double > &  array,
UNUSED double  mag = -1,
UNUSED OptLong  prec = OptLong() 
) const
inlineoverridevirtual

◆ encode() [11/16]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::encode ( UNUSED EncodedPtxt &  eptxt,
UNUSED const std::vector< double > &  array,
UNUSED double  mag = -1,
UNUSED OptLong  prec = OptLong() 
) const
inlineoverridevirtual

◆ encode() [12/16]

template<typename type >
void helib::EncryptedArrayDerived< type >::encode ( zzX &  ptxt,
const PlaintextArray &  array 
) const
overridevirtual

◆ encode() [13/16]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::encode ( zzX &  ptxt,
const std::vector< long > &  array 
) const
inlineoverridevirtual

◆ encode() [14/16]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::encode ( zzX &  ptxt,
const std::vector< NTL::ZZX > &  array 
) const
inlineoverridevirtual

◆ encode() [15/16]

template<typename type >
void helib::EncryptedArrayDerived< type >::encode ( zzX &  ptxt,
const std::vector< RX > &  array 
) const

◆ encode() [16/16]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::encode ( zzX &  ptxt,
const std::vector< zzX > &  array 
) const
inlineoverridevirtual

◆ encodeUnitSelector() [1/2]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::encodeUnitSelector ( EncodedPtxt &  eptxt,
long  i 
) const
inlineoverridevirtual

◆ encodeUnitSelector() [2/2]

template<typename type >
void helib::EncryptedArrayDerived< type >::encodeUnitSelector ( zzX &  ptxt,
long  i 
) const
overridevirtual

Encodes a std::vector with 1 at position i and 0 everywhere else.

Implements helib::EncryptedArrayBase.

◆ getContext()

template<typename type >
virtual const Context& helib::EncryptedArrayDerived< type >::getContext ( ) const
inlineoverridevirtual

◆ getDegree()

template<typename type >
virtual long helib::EncryptedArrayDerived< type >::getDegree ( ) const
inlineoverridevirtual

◆ getG()

template<typename type >
const RX& helib::EncryptedArrayDerived< type >::getG ( ) const
inline

◆ getNormalBasisMatrix()

template<typename type >
const NTL::Mat<R>& helib::EncryptedArrayDerived< type >::getNormalBasisMatrix ( ) const
inline

◆ getNormalBasisMatrixInverse()

template<typename type >
const NTL::Mat<R>& helib::EncryptedArrayDerived< type >::getNormalBasisMatrixInverse ( ) const
inline

◆ getP2R()

template<typename type >
long helib::EncryptedArrayDerived< type >::getP2R ( ) const
inlineoverridevirtual

◆ getPAlgebra()

template<typename type >
virtual const PAlgebra& helib::EncryptedArrayDerived< type >::getPAlgebra ( ) const
inlineoverridevirtual

◆ getTab()

template<typename type >
const PAlgebraModDerived<type>& helib::EncryptedArrayDerived< type >::getTab ( ) const
inline

◆ getTag()

template<typename type >
virtual PA_tag helib::EncryptedArrayDerived< type >::getTag ( ) const
inlineoverridevirtual

◆ initNormalBasisMatrix()

template<typename type >
void helib::EncryptedArrayDerived< type >::initNormalBasisMatrix

◆ operator=()

template<typename type >
EncryptedArrayDerived& helib::EncryptedArrayDerived< type >::operator= ( const EncryptedArrayDerived< type > &  )
delete

◆ random() [1/3]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::random ( std::vector< long > &  array) const
inlineoverridevirtual

◆ random() [2/3]

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::random ( std::vector< NTL::ZZX > &  array) const
inlineoverridevirtual

◆ random() [3/3]

template<typename type >
void helib::EncryptedArrayDerived< type >::random ( std::vector< RX > &  array) const
inline

◆ rawDecrypt() [1/3]

template<typename type >
void helib::EncryptedArrayDerived< type >::rawDecrypt ( UNUSED const Ctxt &  ctxt,
UNUSED const SecKey &  sKey,
UNUSED PlaintextArray &  ptxt 
) const
inlineoverride

◆ rawDecrypt() [2/3]

template<typename type >
void helib::EncryptedArrayDerived< type >::rawDecrypt ( UNUSED const Ctxt &  ctxt,
UNUSED const SecKey &  sKey,
UNUSED std::vector< cx_double > &  ptxt 
) const
inlineoverride

◆ rawDecrypt() [3/3]

template<typename type >
void helib::EncryptedArrayDerived< type >::rawDecrypt ( UNUSED const Ctxt &  ctxt,
UNUSED const SecKey &  sKey,
UNUSED std::vector< double > &  ptxt 
) const
inlineoverride

◆ rawDecryptComplex()

template<typename type >
void helib::EncryptedArrayDerived< type >::rawDecryptComplex ( UNUSED const Ctxt &  ctxt,
UNUSED const SecKey &  sKey,
UNUSED PlaintextArray &  ptxt 
) const
inlineoverride

◆ rawDecryptReal()

template<typename type >
void helib::EncryptedArrayDerived< type >::rawDecryptReal ( UNUSED const Ctxt &  ctxt,
UNUSED const SecKey &  sKey,
UNUSED PlaintextArray &  ptxt 
) const
inlineoverride

◆ restoreContext()

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::restoreContext ( ) const
inlineoverridevirtual

Reimplemented from helib::EncryptedArrayBase.

◆ restoreContextForG()

template<typename type >
virtual void helib::EncryptedArrayDerived< type >::restoreContextForG ( ) const
inlineoverridevirtual

Reimplemented from helib::EncryptedArrayBase.

◆ rotate()

template<typename type >
void helib::EncryptedArrayDerived< type >::rotate ( Ctxt &  ctxt,
long  k 
) const
overridevirtual

Right rotation as a linear array. E.g., rotating ctxt=Enc(1 2 3 ... n) by k=1 gives Enc(n 1 2 ... n-1)

Implements helib::EncryptedArrayBase.

◆ rotate1D() [1/2]

template<typename type >
void helib::EncryptedArrayDerived< type >::rotate1D ( Ctxt &  ctxt,
long  i,
long  k,
bool  dc = false 
) const
overridevirtual

right-rotate k positions along the i'th dimension

Parameters
dcmeans "don't care", which means that the caller guarantees that only zero elements rotate off the end – this allows for some optimizations that would not otherwise be possible

Implements helib::EncryptedArrayBase.

◆ rotate1D() [2/2]

template<typename type >
template<typename U >
void helib::EncryptedArrayDerived< type >::rotate1D ( std::vector< U > &  out,
const std::vector< U > &  in,
long  i,
long  offset 
) const
inline

◆ shift()

template<typename type >
void helib::EncryptedArrayDerived< type >::shift ( Ctxt &  ctxt,
long  k 
) const
overridevirtual

Non-cyclic right shift with zero fill E.g., shifting ctxt=Enc(1 2 3 ... n) by k=1 gives Enc(0 1 2... n-1)

Implements helib::EncryptedArrayBase.

◆ shift1D()

template<typename type >
void helib::EncryptedArrayDerived< type >::shift1D ( Ctxt &  ctxt,
long  i,
long  k 
) const
overridevirtual

Right shift k positions along the i'th dimension with zero fill.

Implements helib::EncryptedArrayBase.