binfhecontext_docs.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. // BSD 2-Clause License
  2. // Copyright (c) 2023, OpenFHE
  3. // All rights reserved.
  4. // Redistribution and use in source and binary forms, with or without
  5. // modification, are permitted provided that the following conditions are met:
  6. // 1. Redistributions of source code must retain the above copyright notice, this
  7. // list of conditions and the following disclaimer.
  8. // 2. Redistributions in binary form must reproduce the above copyright notice,
  9. // this list of conditions and the following disclaimer in the documentation
  10. // and/or other materials provided with the distribution.
  11. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  12. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  13. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  14. // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  15. // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  16. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  17. // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  18. // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  20. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. #ifndef BINFHECONTEXT_DOCSTRINGS_H
  22. #define BINFHECONTEXT_DOCSTRINGS_H
  23. // GenerateBinFHEContext
  24. const char* binfhe_GenerateBinFHEContext_parset_docs = R"pbdoc(
  25. Creates a crypto context using predefined parameter sets. Recommended for most users.
  26. :param set: The parameter set: TOY, MEDIUM, STD128, STD192, STD256.
  27. :type set: BINFHE_PARAMSET
  28. :param method: The bootstrapping method (DM or CGGI).
  29. :type method: BINFHE_METHOD
  30. :return: The created crypto context.
  31. :rtype: BinFHEContext
  32. )pbdoc";
  33. // KeyGen
  34. const char* binfhe_KeyGen_docs = R"pbdoc(
  35. Generates a secret key for the main LWE scheme.
  36. :return: The secret key.
  37. :rtype: LWEPrivateKey
  38. )pbdoc";
  39. // BTKeyGen
  40. const char* binfhe_BTKeyGen_docs = R"pbdoc(
  41. Generates bootstrapping keys.
  42. :param sk: The secret key.
  43. :type sk: LWEPrivateKey
  44. )pbdoc";
  45. // Encrypt
  46. const char* binfhe_Encrypt_docs = R"pbdoc(
  47. Encrypts a bit using a secret key (symmetric key encryption).
  48. :param sk: The secret key.
  49. :type sk: LWEPrivateKey
  50. :param m: The plaintext.
  51. :type m: int
  52. :param output: FRESH to generate a fresh ciphertext, BOOTSTRAPPED to generate a refreshed ciphertext (default).
  53. :type output: BINFHE_OUTPUT
  54. :param p: Plaintext modulus (default 4).
  55. :type p: int
  56. :param mod: Encrypt according to mod instead of m_q if mod != 0.
  57. :type mod: int
  58. :return: The ciphertext.
  59. :rtype: LWECiphertext
  60. )pbdoc";
  61. // Decrypt
  62. const char* binfhe_Decrypt_docs = R"pbdoc(
  63. Decrypts a ciphertext using a secret key.
  64. :param sk: The secret key.
  65. :type sk: LWEPrivateKey
  66. :param ct: The ciphertext.
  67. :type ct: LWECiphertext
  68. :param p: Plaintext modulus (default 4).
  69. :type p: int
  70. :return: The plaintext.
  71. :rtype: int
  72. )pbdoc";
  73. // EvalBinGate
  74. const char* binfhe_EvalBinGate_docs = R"pbdoc(
  75. Evaluates a binary gate (calls bootstrapping as a subroutine).
  76. :param gate: The gate; can be AND, OR, NAND, NOR, XOR, or XNOR.
  77. :type gate: BINGATE
  78. :param ct1: First ciphertext.
  79. :type ct1: LWECiphertext
  80. :param ct2: Second ciphertext.
  81. :type ct2: LWECiphertext
  82. :return: The resulting ciphertext.
  83. :rtype: LWECiphertext
  84. )pbdoc";
  85. // EvalNOT
  86. const char* binfhe_EvalNOT_docs = R"pbdoc(
  87. Evaluates the NOT gate.
  88. :param ct: The input ciphertext.
  89. :type ct: LWECiphertext
  90. :return: The resulting ciphertext.
  91. :rtype: LWECiphertext
  92. )pbdoc";
  93. #endif // BINFHECONTEXT_DOCSTRINGS_H