cryptoparameters_docs.h 5.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 CRYPTOPARAMS_DOCSTRINGS_H
  22. #define CRYPTOPARAMS_DOCSTRINGS_H
  23. const char* ccparams_doc = R"doc(
  24. Crypto parameters for the BFV, BGV and CKKS scheme.
  25. :ivar SCHEME scheme: Scheme ID
  26. :ivar PlaintextModulus ptModulus: PlaintextModulus ptModulus is used in BGV/BFV type schemes and impacts noise growth
  27. :ivar int digitSize: digitSize is used in BV Key Switching only (KeySwitchTechnique = BV) and impacts noise growth
  28. :ivar float standardDeviation: standardDeviation is used for Gaussian error generation
  29. :ivar SecretKeyDist secretKeyDist: Secret key distribution: GAUSSIAN, UNIFORM_TERNARY, etc.
  30. :ivar int maxRelinSkDeg: Max relinearization degree of secret key polynomial (used for lazy relinearization)
  31. :ivar KeySwitchTechnique ksTech: key switching technique: BV or HYBRID currently
  32. :ivar ScalingTechnique scalTech: rescaling/modulus switching technique used in CKKS/BGV: FLEXIBLEAUTOEXT, FIXEDMANUL, FLEXIBLEAUTO, etc.
  33. :ivar int batchSize: max batch size of messages to be packed in encoding (number of slots)
  34. :ivar ProxyReEncryptionMode PREMode: PRE security mode
  35. :ivar MultipartyMode multipartyMode: Multiparty security mode in BFV/BGV
  36. :ivar ExecutionMode executionMode: Execution mode in CKKS
  37. :ivar DecryptionNoiseMode decryptionNoiseMode: Decryption noise mode in CKKS
  38. :ivar float noiseEstimate: Noise estimate in CKKS for NOISE_FLOODING_DECRYPT mode.
  39. :ivar float desiredPrecision: Desired precision for 128-bit CKKS. We use this value in NOISE_FLOODING_DECRYPT mode to determine the scaling factor.
  40. :ivar float statisticalSecurity: Statistical security of CKKS in NOISE_FLOODING_DECRYPT mode. This is the bound on the probability of success that any adversary can have. Specifically, they a probability of success of at most 2^(-statisticalSecurity).
  41. :ivar float numAdversarialQueries: This is the number of adversarial queries a user is expecting for their application, which we use to ensure security of CKKS in NOISE_FLOODING_DECRYPT mode.
  42. :ivar int thresholdNumOfParties: This is the number of parties in a threshold application, which is used for bound on the joint secret key
  43. :ivar int firstModSize: firstModSize and scalingModSize are used to calculate ciphertext modulus. The ciphertext modulus should be seen as: Q = q_0 * q_1 * ... * q_n * q' where q_0 is first prime, and it's number of bits is firstModSize other q_i have same number of bits and is equal to scalingModSize the prime q' is not explicitly given, but it is used internally in CKKS and BGV schemes (in *EXT scaling methods)
  44. :ivar int scalingModSize: firstModSize and scalingModSize are used to calculate ciphertext modulus. The ciphertext modulus should be seen as: Q = q_0 * q_1 * ... * q_n * q' where q_0 is first prime, and it's number of bits is firstModSize other q_i have same number of bits and is equal to scalingModSize the prime q' is not explicitly given, but it is used internally in CKKS and BGV schemes (in *EXT scaling methods)
  45. :ivar int numLargeDigits: see KeySwitchTechnique - number of digits in HYBRID key switching
  46. :ivar int multiplicativeDepth: multiplicative depth
  47. :ivar SecurityLevel securityLevel: security level: We use the values from the security standard at http://homomorphicencryption.org/wp-content/uploads/2018/11/HomomorphicEncryptionStandardv1.1.pdf For given ring dimension and security level we have upper bound of possible highest modulus (Q for BV or P*Q for HYBRID)
  48. :ivar int ringDim: ring dimension N of the scheme : the ring is Z_Q[x] / (X^N+1)
  49. :ivar int evalAddCount: number of additions (used for setting noise in BGV and BFV)
  50. :ivar int keySwitchCount: number of key switching operations (used for setting noise in BGV and BFV)
  51. :ivar int multiHopModSize: size of moduli used for PRE in the provable HRA setting
  52. :ivar EncryptionTechnique encryptionTechnique: STANDARD or EXTENDED mode for BFV encryption
  53. :ivar MultiplicationTechnique multiplicationTechnique: multiplication method in BFV: BEHZ, HPS, etc.
  54. )doc";
  55. #endif // CRYPTOPARAMS_DOCSTRINGS_H