cryptocontext_docs.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. #ifndef CRYPTOCONTEXT_DOCSTRINGS_H
  2. #define CRYPTOCONTEXT_DOCSTRINGS_H
  3. const char* cc_GetRingDimension_docs = R"doc(
  4. Get the ring dimension used for this context
  5. Returns:
  6. int: The ring dimension
  7. )doc";
  8. const char* cc_Enable_docs = R"doc(
  9. Enable a particular feature for use with this CryptoContext
  10. Parameters:
  11. ----------
  12. feature (PKESchemeFeature): the feature that should be enabled.
  13. The list of available features is defined in the PKESchemeFeature enum.
  14. )doc";
  15. const char* cc_KeyGen_docs = R"doc(
  16. Generate a public and private key pair
  17. Returns:
  18. KeyPair: a public/secret key pair
  19. )doc";
  20. const char* cc_EvalMultKeyGen_docs = R"doc(
  21. EvalMultKeyGen creates a key that can be used with the OpenFHE EvalMult operator the new evaluation key is stored in cryptocontext.
  22. Parameters:
  23. ----------
  24. privateKey (PrivateKey): the private key
  25. )doc";
  26. const char* cc_EvalMultKeysGen_docs = R"doc(
  27. EvalMultsKeyGen creates a vector evalmult keys that can be used with the OpenFHE EvalMult operator 1st key (for s^2) is used for multiplication of ciphertexts of depth 1 2nd key (for s^3) is used for multiplication of ciphertexts of depth 2, etc. a vector of new evaluation keys is stored in crytpocontext
  28. Parameters:
  29. ----------
  30. privateKey (PrivateKey): the private key
  31. )doc";
  32. const char* cc_EvalRotateKeyGen_docs = R"doc(
  33. EvalRotateKeyGen generates evaluation keys for a list of indices
  34. Parameters:
  35. ----------
  36. privateKey (PrivateKey): private key
  37. indexList (list): list of (integers) indices
  38. publicKey (PublicKey): public key (used in NTRU schemes)
  39. )doc";
  40. // MakeStringPlaintext
  41. const char* cc_MakeStringPlaintext_docs = R"doc(
  42. MakeStringPlaintext constructs a StringEncoding in this context
  43. Parameters:
  44. ----------
  45. str (str): the string to convert
  46. Returns:
  47. ----------
  48. Plaintext: plaintext
  49. )doc";
  50. //MakePackedPlaintext
  51. const char* cc_MakePackedPlaintext_docs = R"doc(
  52. MakePackedPlaintext constructs a PackedEncoding in this context
  53. Parameters:
  54. ----------
  55. value (list): the vector (of integers) to convert
  56. depth (int): is the multiplicative depth to encode the plaintext at
  57. level (int): is the level to encode the plaintext at
  58. Returns:
  59. ----------
  60. Plaintext: plaintext
  61. )doc";
  62. //MakeCKKSPackedPlaintext(const std::vector<std::complex<double>> &value, size_t depth = 1, uint32_t level = 0, const std::shared_ptr<ParmType> params = nullptr, usint slots = 0)
  63. const char* cc_MakeCKKSPackedPlaintextComplex_docs = R"doc(
  64. COMPLEX ARITHMETIC IS NOT AVAILABLE STARTING WITH OPENFHE 1.10.6, AND THIS METHOD BE DEPRECATED. USE THE REAL-NUMBER METHOD INSTEAD. MakeCKKSPackedPlaintext constructs a CKKSPackedEncoding in this context from a vector of complex numbers
  65. Parameters:
  66. ----------
  67. value (list): input vector (of complex numbers)
  68. depth (int): depth used to encode the vector
  69. level (int): level at each the vector will get encrypted
  70. params (openfhe.ParmType): parameters to be used for the ciphertext (Only accepting params = None in this version)
  71. slots (int): number of slots
  72. Returns:
  73. ----------
  74. Plaintext: plaintext
  75. )doc";
  76. //MakeCKKSPlaintextReal
  77. const char* cc_MakeCKKSPlaintextReal_docs = R"doc(
  78. MakeCKKSPlaintext constructs a CKKSPackedEncoding in this context from a vector of real numbers
  79. Parameters:
  80. ----------
  81. value (list): input vector (of floats)
  82. depth (int): depth used to encode the vector
  83. level (int): level at each the vector will get encrypted
  84. params (openfhe.ParmType): parameters to be used for the ciphertext (Only accepting params = None in this version)
  85. slots (int): number of slots
  86. Returns:
  87. ----------
  88. Plaintext: plaintext
  89. )doc";
  90. //EvalRotate
  91. const char* cc_EvalRotate_docs = R"doc(
  92. EvalRotate rotates a ciphertext by a given index
  93. Parameters:
  94. ----------
  95. ciphertext (Ciphertext): the ciphertext to rotate
  96. index (int): the index of the rotation. Positive indices correspond to left rotations and negative indices correspond to right rotations.
  97. Returns:
  98. ----------
  99. Ciphertext: the rotated ciphertext
  100. )doc";
  101. //EvalFastRotationPreCompute
  102. const char* cc_EvalFastRotationPreCompute_docs = R"doc(
  103. EvalFastRotationPrecompute implements the precomputation step of hoisted automorphisms.
  104. Please refer to Section 5 of Halevi and Shoup, "Faster Homomorphic
  105. linear transformations in HELib." for more details, link:
  106. https://eprint.iacr.org/2018/244.
  107. Generally, automorphisms are performed with three steps:
  108. (1) The automorphism is applied to the ciphertext.
  109. (2) The automorphed values are decomposed into digits.
  110. (3) Key switching is applied to enable further computations on the ciphertext.
  111. Hoisted automorphisms are a technique that performs the digit decomposition for the original ciphertext first,
  112. and then performs the automorphism and the key switching on the decomposed digits.
  113. The benefit of this is that the digit decomposition is independent of the automorphism rotation index,
  114. so it can be reused for multiple different indices.
  115. This can greatly improve performance when we have to compute many automorphisms on the same ciphertext.
  116. This routinely happens when we do permutations (EvalPermute).
  117. EvalFastRotationPrecompute implements the digit decomposition step of hoisted automorphisms.
  118. Parameters:
  119. ----------
  120. ciphertext (Ciphertext): the input ciphertext on which to do the precomputation (digit decomposition)
  121. Returns:
  122. ----------
  123. Ciphertext: the precomputed ciphertext created using the digit decomposition
  124. )doc";
  125. //EvalFastRotation
  126. const char* cc_EvalFastRotation_docs = R"doc(
  127. EvalFastRotation implements the automorphism and key switching step of hoisted automorphisms.
  128. Please refer to Section 5 of Halevi and Shoup, "Faster Homomorphic
  129. linear transformations in HELib." for more details, link:
  130. https://eprint.iacr.org/2018/244.
  131. Generally, automorphisms are performed with three steps:
  132. (1) The automorphism is applied to the ciphertext.
  133. (2) The automorphed values are decomposed into digits.
  134. (3) Key switching is applied to enable further computations on the ciphertext.
  135. Hoisted automorphisms are a technique that performs the digit decomposition for the original ciphertext first,
  136. and then performs the automorphism and the key switching on the decomposed digits.
  137. The benefit of this is that the digit decomposition is independent of the automorphism rotation index,
  138. so it can be reused for multiple different indices.
  139. This can greatly improve performance when we have to compute many automorphisms on the same ciphertext.
  140. This routinely happens when we do permutations (EvalPermute).
  141. EvalFastRotation implements the automorphism and key switching step of hoisted automorphisms.
  142. This method assumes that all required rotation keys exist.
  143. This may not be true if we are using baby-step/giant-step key switching.
  144. Please refer to Section 5.1 of the above reference and EvalPermuteBGStepHoisted to see how to deal with this issue.
  145. Parameters:
  146. ----------
  147. ciphertext (Ciphertext): the input ciphertext to perform the automorphism on
  148. index (int): the index of the rotation. Positive indices correspond to left rotations and negative indices correspond to right rotations.
  149. m (int): is the cyclotomic order
  150. digits (Ciphertext): the precomputed ciphertext created by EvalFastRotationPrecompute using the digit decomposition at the precomputation step
  151. )doc";
  152. //EvalFastRotationExt
  153. const char* cc_EvalFastRotationExt_docs = R"doc(
  154. Only supported for hybrid key switching. Performs fast (hoisted) rotation and returns the results in the extended CRT basis P*Q
  155. Parameters:
  156. ----------
  157. ciphertext (Ciphertext): input ciphertext
  158. index (int): the rotation index
  159. digits (Ciphertext): the precomputed ciphertext created by EvalFastRotationPrecompute
  160. addFirst (bool): if true, the the first element c0 is also computed (otherwise ignored)
  161. Returns:
  162. ----------
  163. Ciphertext: resulting ciphertext
  164. )doc";
  165. //void EvalAtIndexKeyGen(const PrivateKey<Element> privateKey, const std::vector<int32_t> &indexList, const PublicKey<Element> publicKey = nullptr)
  166. const char* cc_EvalAtIndexKeyGen_docs = R"doc(
  167. EvalAtIndexKeyGen generates evaluation keys for a list of indices
  168. Parameters:
  169. ----------
  170. privateKey (PrivateKey): the private key
  171. indexList (list): list of indices
  172. publicKey (PublicKey): the public key (used in NTRU schemes)
  173. Returns:
  174. ----------
  175. None
  176. )doc";
  177. //Encrypt
  178. const char* cc_Encrypt_docs = R"doc(
  179. Encrypt a plaintext using a given public key
  180. Parameters:
  181. ----------
  182. plaintext (Plaintext): the plaintext to encrypt
  183. publicKey (PublicKey): the public key
  184. Returns:
  185. ----------
  186. Ciphertext: ciphertext (or null on failure)
  187. )doc";
  188. //Decrypt
  189. const char* cc_Decrypt_docs = R"doc(
  190. Decrypt a single ciphertext into the appropriate plaintext
  191. Parameters:
  192. ----------
  193. ciphertext (Ciphertext): ciphertext to decrypt
  194. privateKey (PrivateKey): decryption key
  195. Returns:
  196. ----------
  197. Plaintext: decrypted plaintext
  198. )doc";
  199. //EvalAdd
  200. const char* cc_EvalAdd_docs = R"doc(
  201. Add two ciphertexts
  202. Parameters:
  203. ----------
  204. ct1 (Ciphertext): first ciphertext
  205. ct2 (Ciphertext): second ciphertext
  206. Returns:
  207. ----------
  208. Ciphertext: resulting ciphertext
  209. )doc";
  210. //EvalAdd(ciphertext,double)
  211. const char* cc_EvalAddfloat_docs = R"doc(
  212. EvalAdd - OpenFHE EvalAdd method for a ciphertext and constant
  213. Parameters:
  214. ----------
  215. ct (Ciphertext): ciphertext
  216. constant (float): constant to add
  217. Returns:
  218. ----------
  219. Ciphertext: new ciphertext for ciphertext + constant
  220. )doc";
  221. //EvalAddInPlace
  222. const char* cc_EvalAddInPlace_docs = R"doc(
  223. EvalAdd - OpenFHE EvalAddInPlace method for a pair of ciphertexts
  224. Parameters:
  225. ----------
  226. ct1 (Ciphertext): Input/output ciphertext
  227. ct2 (Ciphertext): Input cipherext
  228. Returns:
  229. ----------
  230. ct1 contains ct1 + ct2
  231. )doc";
  232. //EvalAddInPlace(ciphertext,plaintext)
  233. const char* cc_EvalAddInPlacePlaintext_docs = R"doc(
  234. EvalAdd - OpenFHE EvalAddInPlace method for a ciphertext and plaintext
  235. Parameters:
  236. ----------
  237. ct (Ciphertext): Input/output ciphertext
  238. pt (Plaintext): Input plaintext
  239. Returns:
  240. ----------
  241. ct contains ct + pt
  242. )doc";
  243. //EvalAddMutable
  244. const char* cc_EvalAddMutable_docs = R"doc(
  245. EvalAdd - OpenFHE EvalAddMutable method for a pair of ciphertexts. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced.
  246. Parameters:
  247. ----------
  248. ct1 (Ciphertext): first ciphertext
  249. ct2 (Ciphertext): second ciphertext
  250. Returns:
  251. ----------
  252. Ciphertext: new ciphertext for ct1 + ct2
  253. )doc";
  254. //EvalAddMutable(ciphertext,plaintext)
  255. const char* cc_EvalAddMutablePlaintext_docs = R"doc(
  256. EvalAdd - OpenFHE EvalAddMutable method for a ciphertext and plaintext. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced.
  257. Parameters:
  258. ----------
  259. ct (Ciphertext): ciphertext
  260. pt (Plaintext): plaintext
  261. Returns:
  262. ----------
  263. Ciphertext: new ciphertext for ct + pt
  264. )doc";
  265. //EvalAddMutableInPlace
  266. const char* cc_EvalAddMutableInPlace_docs = R"doc(
  267. EvalAdd - Inplace version of EvalAddMutable
  268. Parameters:
  269. ----------
  270. ct1 (Ciphertext): Input/output ciphertext
  271. ct2 (Ciphertext): Input cipherext
  272. Returns:
  273. ----------
  274. ct1 contains ct1 + ct2
  275. )doc";
  276. //EvalSub
  277. const char* cc_EvalSub_docs = R"doc(
  278. EvalSub - OpenFHE EvalSub method for a pair of ciphertexts
  279. Parameters:
  280. ----------
  281. ct1 (Ciphertext): first ciphertext
  282. ct2 (Ciphertext): second ciphertext
  283. Returns:
  284. ----------
  285. Ciphertext: new ciphertext for ct1 - ct2
  286. )doc";
  287. //EvalSub(ciphertext,double)
  288. const char* cc_EvalSubfloat_docs = R"doc(
  289. EvalSub - OpenFHE EvalSub method for a ciphertext and constant
  290. Parameters:
  291. ----------
  292. ct (Ciphertext): ciphertext
  293. constant (float): constant to subtract
  294. Returns:
  295. ----------
  296. Ciphertext: new ciphertext for ciphertext - constant
  297. )doc";
  298. //EvalSub(ciphertext,plaintext)
  299. const char* cc_EvalSubPlaintext_docs = R"doc(
  300. EvalSub - OpenFHE EvalSub method for a ciphertext and plaintext
  301. Parameters:
  302. ----------
  303. ciphertext (Ciphertext): ciphertext
  304. plaintext (Plaintext): plaintext
  305. Returns:
  306. ----------
  307. Ciphertext: new ciphertext for ciphertext - plaintext
  308. )doc";
  309. //EvalSubInPlace
  310. const char* cc_EvalSubInPlace_docs = R"doc(
  311. Inplace version of EvalSub for a pair of ciphertexts
  312. Parameters:
  313. ----------
  314. ct1 (Ciphertext): Input/output ciphertext
  315. ct2 (Ciphertext): Input cipherext
  316. Returns:
  317. ----------
  318. ct1 contains ct1 - ct2
  319. )doc";
  320. //EvalSubInPlace(ciphertext,double)
  321. const char* cc_EvalSubInPlacefloat_docs = R"doc(
  322. Inplace version of EvalSub for a ciphertext and constant
  323. Parameters:
  324. ----------
  325. ciphertext (Ciphertext): Input/output ciphertext
  326. constant (float): constant to subtract
  327. Returns:
  328. ----------
  329. ciphertext contains ciphertext - constant
  330. )doc";
  331. //EvalSubMutable
  332. const char* cc_EvalSubMutable_docs = R"doc(
  333. EvalSub - OpenFHE EvalSubMutable method for a pair of ciphertexts. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced.
  334. Parameters:
  335. ----------
  336. ct1 (Ciphertext): first ciphertext
  337. ct2 (Ciphertext): second ciphertext
  338. Returns:
  339. ----------
  340. Ciphertext: new ciphertext for ct1 - ct2
  341. )doc";
  342. //EvalSubMutable(ciphertext,plaintext)
  343. const char* cc_EvalSubMutablePlaintext_docs = R"doc(
  344. EvalSub - OpenFHE EvalSubMutable method for a ciphertext and plaintext. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced.
  345. Parameters:
  346. ----------
  347. ciphertext (Ciphertext):
  348. plaintext (Plaintext):
  349. Returns:
  350. ----------
  351. Ciphertext: new ciphertext for ciphertext - plaintext
  352. )doc";
  353. //EvalMult
  354. const char* cc_EvalMult_docs = R"doc(
  355. EvalMult - OpenFHE EvalMult method for a pair of ciphertexts - with key switching
  356. Parameters:
  357. ----------
  358. ct1 (Ciphertext): first ciphertext
  359. ct2 (Ciphertext): second ciphertext
  360. Returns:
  361. ----------
  362. Ciphertext: new ciphertext for ct1 * ct2
  363. )doc";
  364. //EvalMult(ciphertext,double)
  365. const char* cc_EvalMultfloat_docs = R"doc(
  366. EvalMult - OpenFHE EvalMult method for a ciphertext and constant
  367. Parameters:
  368. ----------
  369. ciphertext (Ciphertext): the ciphertext
  370. constant (float): constant to multiply
  371. Returns:
  372. ----------
  373. Ciphertext: new ciphertext for ciphertext * constant
  374. )doc";
  375. //EvalMult(ciphertext,plaintext)
  376. const char* cc_EvalMultPlaintext_docs = R"doc(
  377. EvalMult - OpenFHE EvalMult method for a ciphertext and plaintext
  378. Parameters:
  379. ----------
  380. ciphertext (Ciphertext): the ciphertext
  381. plaintext (Plaintext): the plaintext
  382. Returns:
  383. ----------
  384. Ciphertext: new ciphertext for ciphertext * plaintext
  385. )doc";
  386. //EvalMultMutable
  387. const char* cc_EvalMultMutable_docs = R"doc(
  388. EvalMult - OpenFHE EvalMultMutable method for a pair of ciphertexts. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced.
  389. Parameters:
  390. ----------
  391. ct1 (Ciphertext): first ciphertext
  392. ct2 (Ciphertext): second ciphertext
  393. Returns:
  394. ----------
  395. Ciphertext: new ciphertext for ct1 * ct2
  396. )doc";
  397. //EvalMultMutable(ciphertext,plaintext)
  398. const char* cc_EvalMultMutablePlaintext_docs = R"doc(
  399. EvalMult - OpenFHE EvalMultMutable method for a ciphertext and plaintext. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced.
  400. Parameters:
  401. ----------
  402. ciphertext (Ciphertext): the ciphertext
  403. plaintext (Plaintext): the plaintext
  404. Returns:
  405. ----------
  406. Ciphertext: new ciphertext for ciphertext * plaintext
  407. )doc";
  408. //EvalMultMutableInPlace
  409. const char* cc_EvalMultMutableInPlace_docs = R"doc(
  410. EvalMult - OpenFHE EvalMult method for a pair of ciphertexts - with key switching This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced.
  411. Parameters:
  412. ----------
  413. ct1 (Ciphertext): Input/output ciphertext
  414. ct2 (Ciphertext): Input cipherext
  415. Returns:
  416. ----------
  417. ct1 contains ct1 * ct2
  418. )doc";
  419. //EvalSquare
  420. const char* cc_EvalSquare_docs = R"doc(
  421. EvalSquare - OpenFHE EvalSquare method for a ciphertext
  422. Parameters:
  423. ----------
  424. ct (Ciphertext): the ciphertext to square
  425. Returns:
  426. ----------
  427. Ciphertext: new ciphertext for ct^2 = ct * ct
  428. )doc";
  429. //EvalSquareMutable
  430. const char* cc_EvalSquareMutable_docs = R"doc(
  431. EvalSquare - OpenFHE EvalSquareMutable method for a ciphertext. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced.
  432. Parameters:
  433. ----------
  434. ct (Ciphertext): the ciphertext to square
  435. Returns:
  436. ----------
  437. Ciphertext: new ciphertext for ct^2 = ct * ct
  438. )doc";
  439. //EvalSquareInPlace
  440. const char* cc_EvalSquareInPlace_docs = R"doc(
  441. EvalSquare - OpenFHE EvalSquare method for a ciphertext. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced.
  442. Parameters:
  443. ----------
  444. ct (Ciphertext): Input/output ciphertext
  445. Returns:
  446. ----------
  447. ct contains ct^2 = ct * ct
  448. )doc";
  449. //EvalMultNoRelin
  450. const char* cc_EvalMultNoRelin_docs = R"doc(
  451. EvalMultNoRelin - OpenFHE EvalMult method for a pair of ciphertexts - no key switching (relinearization)
  452. Parameters:
  453. ----------
  454. ct1 (Ciphertext): first ciphertext
  455. ct2 (Ciphertext): second ciphertext
  456. Returns:
  457. ----------
  458. Ciphertext: new ciphertext for ct1 * ct2
  459. )doc";
  460. //Relinearize
  461. const char* cc_Relinearize_docs = R"doc(
  462. Function for relinearization of a ciphertext.
  463. Parameters:
  464. ----------
  465. ct (Ciphertext): input ciphertext
  466. Returns:
  467. ----------
  468. Ciphertext: relienarized ciphertext
  469. )doc";
  470. //RelinearizeInPlace
  471. const char* cc_RelinearizeInPlace_docs = R"doc(
  472. Function for inplace relinearization of a ciphertext.
  473. Parameters:
  474. ----------
  475. ct (Ciphertext): input/output ciphertext
  476. Returns:
  477. ----------
  478. ct contains relienarized ciphertext
  479. )doc";
  480. //EvalMultAndRelinearize
  481. const char* cc_EvalMultAndRelinearize_docs = R"doc(
  482. Function for evaluating multiplication on ciphertext followed by relinearization operation. Currently it assumes that the input arguments have total depth smaller than the supported depth. Otherwise, it throws an error
  483. Parameters:
  484. ----------
  485. ct1 (Ciphertext): first input ciphertext
  486. ct2 (Ciphertext): second input ciphertext
  487. Returns:
  488. ----------
  489. Ciphertext: new ciphertext
  490. )doc";
  491. //EvalNegate
  492. const char* cc_EvalNegate_docs = R"doc(
  493. EvalSub - OpenFHE Negate method for a ciphertext
  494. Parameters:
  495. ----------
  496. ct (Ciphertext): input ciphertext
  497. Returns:
  498. ----------
  499. Ciphertext: new ciphertext -ct
  500. )doc";
  501. //EvalNegateInPlace
  502. const char* cc_EvalNegateInPlace_docs = R"doc(
  503. EvalSub - Inplace OpenFHE Negate method for a ciphertext
  504. Parameters:
  505. ----------
  506. ct (Ciphertext): input/output ciphertext
  507. Returns:
  508. ----------
  509. ct contains -ct
  510. )doc";
  511. //EvalLogistic((ConstCiphertext<Element> ciphertext, double a, double b, uint32_t degree)
  512. const char* cc_EvalLogistic_docs = R"doc(
  513. Evaluate approximate logistic function 1/(1 + exp(-x)) on a ciphertext using the Chebyshev approximation.
  514. Parameters:
  515. ----------
  516. ciphertext (Ciphertext): input ciphertext
  517. a (float): lower bound of argument for which the coefficients were found
  518. b (float): upper bound of argument for which the coefficients were found
  519. degree (int): Desired degree of approximation
  520. Returns:
  521. ----------
  522. Ciphertext: the result of polynomial evaluation
  523. )doc";
  524. //EvalChebyshevSeries(ConstCiphertext<Element> ciphertext, const std::vector<double> &coefficients, double a, double b)
  525. const char* cc_EvalChebyshevSeries_docs = R"doc(
  526. Method for evaluating Chebyshev polynomial interpolation; first the range [a,b] is mapped to [-1,1] using linear transformation 1 + 2 (x-a)/(b-a) If the degree of the polynomial is less than 5, use EvalChebyshevSeriesLinear, otherwise, use EvalChebyshevSeriesPS.
  527. Parameters:
  528. ----------
  529. ciphertext (Ciphertext): input ciphertext
  530. coefficients (list): is the list of coefficients in Chebyshev expansion
  531. a (float): lower bound of argument for which the coefficients were found
  532. b (float): upper bound of argument for which the coefficients were found
  533. Returns:
  534. ----------
  535. Ciphertext: the result of polynomial evaluation
  536. )doc";
  537. #endif //CRYPTOCONTEXT_DOCSTRINGS_H