12 #ifndef HELIB_POLYEVAL_H
13 #define HELIB_POLYEVAL_H
19 #include <helib/Context.h>
20 #include <helib/Ctxt.h>
30 void polyEval(Ctxt& ret, NTL::ZZX poly,
const Ctxt& x,
long k = 0);
37 void polyEval(Ctxt& ret,
const NTL::Vec<Ctxt>& poly,
const Ctxt& x);
54 assertFalse<InvalidArgument>(c.
isEmpty(),
"Ciphertext cannot be empty");
55 assertTrue<InvalidArgument>(nPowers > 0,
"Must have positive nPowers");
58 v.resize(nPowers, tmp);
69 const std::vector<Ctxt>&
getVector()
const {
return v; }
70 long size()
const {
return v.size(); }
73 return (i > 0 && i <= (
long)v.size() && !v[i - 1].isEmpty());
A Ctxt object holds a single ciphertext.
Definition: Ctxt.h:396
bool isEmpty() const
Is this an empty ciphertext without any parts.
Definition: Ctxt.h:1350
const PubKey & getPubKey() const
Definition: Ctxt.h:1368
long getPtxtSpace() const
Definition: Ctxt.h:1370
Store powers of X, compute them dynamically as needed.
Definition: polyEval.h:46
long size() const
Definition: polyEval.h:70
const std::vector< Ctxt > & getVector() const
Definition: polyEval.h:69
Ctxt & operator[](long i)
Definition: polyEval.h:67
Ctxt & at(long i)
dp.at(i) and dp[i] both return the i+1st power
Definition: polyEval.h:66
DynamicCtxtPowers(const Ctxt &c, long nPowers)
Definition: polyEval.h:51
bool isPowerComputed(long i)
Definition: polyEval.h:71
Ctxt & getPower(long e)
Returns the e'th power, computing it as needed.
Definition: polyEval.cpp:18
Definition: apiAttributes.h:21
void polyEval(Ctxt &ret, NTL::ZZX poly, const Ctxt &x, long k=0)
Evaluate a cleartext polynomial on an encrypted input.
Definition: polyEval.cpp:129