diff --git a/src/include/docstrings/binfhecontext_docs.h b/src/include/docstrings/binfhecontext_docs.h index f8db13e..113a97e 100644 --- a/src/include/docstrings/binfhecontext_docs.h +++ b/src/include/docstrings/binfhecontext_docs.h @@ -58,7 +58,7 @@ const char* binfhe_BTKeyGen_docs = R"pbdoc( // Encrypt const char* binfhe_Encrypt_docs = R"pbdoc( - Encrypts a bit using a secret key (symmetric key encryption). + Encrypts a bit or integer using a secret key (symmetric key encryption). :param sk: The secret key. :type sk: LWEPrivateKey diff --git a/src/include/docstrings/cryptocontext_docs.h b/src/include/docstrings/cryptocontext_docs.h index b07ed1a..de36207 100644 --- a/src/include/docstrings/cryptocontext_docs.h +++ b/src/include/docstrings/cryptocontext_docs.h @@ -39,14 +39,14 @@ namespace py = pybind11; // auto cc_docs2 = py::doc(cc_docs); const char* cc_SetKeyGenLevel_docs = R"pbdoc( - Set the level used for key generation + For future use: setter for the level at which evaluation keys should be generated :param level: the level to set the key generation to :type level: int )pbdoc"; const char* cc_GetKeyGenLevel_docs = R"pbdoc( - Get the level used for key generation + For future use: getter for the level at which evaluation keys should be generated :return: The level used for key generation :rtype: int @@ -114,7 +114,7 @@ const char* cc_EvalMultKeysGen_docs = R"pbdoc( )pbdoc"; const char* cc_EvalRotateKeyGen_docs = R"pbdoc( - EvalRotateKeyGen generates evaluation keys for a list of indices + EvalRotateKeyGen generates evaluation keys for a list of indices. Calls EvalAtIndexKeyGen under the hood. :param privateKey: private key :type privateKey: PrivateKey @@ -124,11 +124,10 @@ const char* cc_EvalRotateKeyGen_docs = R"pbdoc( :type publicKey: PublicKey )pbdoc"; -// MakeStringPlaintext const char* cc_MakeStringPlaintext_docs = R"pbdoc( MakeStringPlaintext constructs a StringEncoding in this context. - :param str: the string to convert + :param str: string to be encoded :type str: str :return: plaintext )pbdoc"; @@ -136,10 +135,10 @@ const char* cc_MakeStringPlaintext_docs = R"pbdoc( const char* cc_MakePackedPlaintext_docs = R"pbdoc( MakePackedPlaintext constructs a PackedEncoding in this context - :param value: the vector (of integers) to convert - :type value: list - :param depth: is the multiplicative depth to encode the plaintext at - :type depth: int + :param value: vector of signed integers mod t + :type value: List[int] + :param noiseScaleDeg: is degree of the scaling factor to encode the plaintext at + :type noiseScaleDeg: int :param level: is the level to encode the plaintext at :type level: int :return: plaintext @@ -149,10 +148,10 @@ const char* cc_MakePackedPlaintext_docs = R"pbdoc( const char* cc_MakeCoefPackedPlaintext_docs = R"pbdoc( MakeCoefPackedPlaintext constructs a CoefPackedEncoding in this context - :param value: the vector (of integers) to convert - :type value: list - :param depth: is the multiplicative depth to encode the plaintext at - :type depth: int + :param value: vector of signed integers mod t + :type value: List[int] + :param noiseScaleDeg : is degree of the scaling factor to encode the plaintext at + :type noiseScaleDeg : int :param level: is the level to encode the plaintext at :type level: int :return: plaintext @@ -160,10 +159,10 @@ const char* cc_MakeCoefPackedPlaintext_docs = R"pbdoc( )pbdoc"; const char* cc_MakeCKKSPackedPlaintextComplex_docs = R"pbdoc( - 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 + COMPLEX ARITHMETIC IS NOT AVAILABLE, AND THIS METHOD BE DEPRECATED. USE THE REAL-NUMBER METHOD INSTEAD. MakeCKKSPackedPlaintext constructs a CKKSPackedEncoding in this context from a vector of complex numbers - :param value: input vector (of complex numbers) - :type value: list + :param value: input vector of complex numbers + :type value: List[complex] :param scaleDeg: degree of scaling factor used to encode the vector :type scaleDeg: int :param level: level at each the vector will get encrypted @@ -194,13 +193,13 @@ const char* cc_MakeCKKSPlaintextReal_docs = R"pbdoc( )pbdoc"; const char* cc_EvalRotate_docs = R"pbdoc( - EvalRotate rotates a ciphertext by a given index + Rotates a ciphertext by an index (positive index is a left shift, negative index is a right shift). Uses a rotation key stored in a crypto context. Calls EvalAtIndex under the hood. - :param ciphertext: the ciphertext to rotate + :param ciphertext: input ciphertext :type ciphertext: Ciphertext - :param index: the index of the rotation. Positive indices correspond to left rotations and negative indices correspond to right rotations. + :param index: rotation index :type index: int - :return: the rotated ciphertext + :return: a rotated ciphertext :rtype: Ciphertext )pbdoc"; @@ -285,24 +284,24 @@ const char* cc_EvalFastRotationExt_docs = R"pbdoc( )pbdoc"; const char* cc_EvalAtIndex_docs = R"pbdoc( - Moves i-th slot to slot 0 + Rotates a ciphertext by an index (positive index is a left shift, negative index is a right shift). Uses a rotation key stored in a crypto context. - :param ciphertext: the ciphertext + :param ciphertext: input ciphertext :type ciphertext: Ciphertext - :param i: the index + :param i: rotation index :type i: int - :return: resulting ciphertext + :return: a rotated ciphertext :rtype: Ciphertext )pbdoc"; const char* cc_EvalAtIndexKeyGen_docs = R"pbdoc( - EvalAtIndexKeyGen generates evaluation keys for a list of indices + EvalAtIndexKeyGen generates evaluation keys for a list of rotation indices :param privateKey: the private key :type privateKey: PrivateKey :param indexList: list of indices :type indexList: list - :param publicKey: the public key (used in NTRU schemes) + :param publicKey: the public key (used in NTRU schemes). Not used anymore. :type publicKey: PublicKey :return: None )pbdoc"; @@ -310,9 +309,9 @@ const char* cc_EvalAtIndexKeyGen_docs = R"pbdoc( const char* cc_Encrypt_docs = R"doc( Encrypt a plaintext using a given public key - :param plaintext: the plaintext to encrypt + :param plaintext: plaintext :type plaintext: Plaintext - :param publicKey: the public key + :param publicKey: public key :type publicKey: PublicKey :return: ciphertext (or null on failure) :rtype: Ciphertext @@ -341,60 +340,60 @@ const char* cc_KeySwitchGen_docs = R"pbdoc( )pbdoc"; const char* cc_EvalAdd_docs = R"pbdoc( -Add two ciphertexts +Homomorphic addition of two ciphertexts -:param ct1: first ciphertext -:type ct1: Ciphertext -:param ct2: second ciphertext -:type ct2: Ciphertext -:return: resulting ciphertext +:param ciphertext1: first addend +:type ciphertext1: Ciphertext +:param ciphertext2: second addend +:type ciphertext2: Ciphertext +:return: the result as a new ciphertext :rtype: Ciphertext )pbdoc"; const char* cc_EvalAddfloat_docs = R"pbdoc( -EvalAdd - OpenFHE EvalAdd method for a ciphertext and constant +EvalAdd - OpenFHE EvalAdd method for a ciphertext and a real number. Supported only in CKKS. -:param ct: ciphertext -:type ct: Ciphertext -:param constant: constant to add +:param ciphertext: input ciphertext +:type ciphertext: Ciphertext +:param constant: a real number :type constant: float :return: new ciphertext for ciphertext + constant :rtype: Ciphertext )pbdoc"; const char* cc_EvalAddInPlace_docs = R"pbdoc( -EvalAdd - OpenFHE EvalAddInPlace method for a pair of ciphertexts +In-place homomorphic addition of two ciphertexts -:param ct1: Input/output ciphertext -:type ct1: Ciphertext -:param ct2: Input ciphertext -:type ct2: Ciphertext -:return: ct1 contains ct1 + ct2 +:param ciphertext1: ciphertext1 +:type ciphertext1: Ciphertext +:param ciphertext2: second addend +:type ciphertext2: Ciphertext +:return: ciphertext1 contains ciphertext1 + ciphertext2 )pbdoc"; const char* cc_EvalAddInPlacePlaintext_docs = R"pbdoc( -EvalAdd - OpenFHE EvalAddInPlace method for a ciphertext and plaintext +In-place addition for a ciphertext and plaintext -:param ct: Input/output ciphertext -:type ct: Ciphertext -:param pt: Input plaintext -:type pt: Plaintext -:return: ct contains ct + pt +:param ciphertext: Input/output ciphertext +:type ciphertext: Ciphertext +:param plaintext: Input plaintext +:type plaintext: Plaintext +:return: ciphertext contains ciphertext + plaintext )pbdoc"; const char* cc_EvalAddMutable_docs = R"pbdoc( -EvalAdd - OpenFHE EvalAddMutable method for a pair of ciphertexts. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced. +Homomorphic addition of two mutable ciphertexts (they can be changed during the operation) -:param ct1: first ciphertext -:type ct1: Ciphertext -:param ct2: second ciphertext -:type ct2: Ciphertext -:return: new ciphertext for ct1 + ct2 +:param ciphertext1: first addend +:type ciphertext1: Ciphertext +:param ciphertext2: second addend +:type ciphertext2: Ciphertext +:return: the result as a new ciphertext :rtype: Ciphertext )pbdoc"; const char* cc_EvalAddMutablePlaintext_docs = R"pbdoc( -EvalAdd - OpenFHE EvalAddMutable method for a ciphertext and plaintext. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced. +Homomorphic addition a mutable ciphertext and plaintext :param ciphertext: ciphertext :type ciphertext: Ciphertext @@ -406,255 +405,250 @@ EvalAdd - OpenFHE EvalAddMutable method for a ciphertext and plaintext. This is const char* cc_EvalAddMutableInPlace_docs = R"pbdoc( - EvalAdd - Inplace version of EvalAddMutable + Homomorphic addition a mutable ciphertext and plaintext - :param ct1: Input/output ciphertext - :type ct1: Ciphertext - :param ct2: Input ciphertext - :type ct2: Ciphertext - :return: ct1 contains ct1 + ct2 + :param ciphertext1: first addend + :type ciphertext1: Ciphertext + :param ciphertext2: second addend + :type ciphertext2: Ciphertext + :return: ciphertext1 contains ciphertext1 + ciphertext2 )pbdoc"; const char* cc_EvalSub_docs = R"pbdoc( -EvalSub - OpenFHE EvalSub method for a pair of ciphertexts +Homomorphic subtraction of two ciphertexts -:param ct1: first ciphertext -:type ct1: Ciphertext -:param ct2: second ciphertext -:type ct2: Ciphertext -:return: new ciphertext for ct1 - ct2 +:param ciphertext1: minuend +:type ciphertext1: Ciphertext +:param ciphertext2: subtrahend +:type ciphertext2: Ciphertext +:return: the result as a new ciphertext :rtype: Ciphertext )pbdoc"; const char* cc_EvalSubfloat_docs = R"pbdoc( -EvalSub - OpenFHE EvalSub method for a ciphertext and constant +Subtraction of a ciphertext and a real number. Supported only in CKKS. -:param ciphertext: ciphertext +:param ciphertext: input ciphertext :type ciphertext: Ciphertext -:param constant: constant to subtract +:param constant: a real number :type constant: float :return: new ciphertext for ciphertext - constant :rtype: Ciphertext )pbdoc"; const char* cc_EvalSubPlaintext_docs = R"pbdoc( -EvalSub - OpenFHE EvalSub method for a ciphertext and plaintext +Subtraction of a ciphertext and a real number. Supported only in CKKS. -:param ciphertext: ciphertext +:param ciphertext: minuend :type ciphertext: Ciphertext -:param plaintext: plaintext +:param plaintext: subtrahend :type plaintext: Plaintext :return: new ciphertext for ciphertext - plaintext :rtype: Ciphertext )pbdoc"; const char* cc_EvalSubInPlace_docs = R"pbdoc( -Inplace version of EvalSub for a pair of ciphertexts +In-place homomorphic subtraction of two ciphertexts -:param ct1: Input/output ciphertext -:type ct1: Ciphertext -:param ct2: Input ciphertext -:type ct2: Ciphertext -:return: ct1 contains ct1 - ct2 +:param ciphertext1: minuend +:type ciphertext1: Ciphertext +:param ciphertext2: subtrahend +:type ciphertext2: Ciphertext +:return: the result as a new ciphertext )pbdoc"; const char* cc_EvalSubInPlacefloat_docs = R"pbdoc( -Inplace version of EvalSub for a ciphertext and constant +In-place subtraction of a ciphertext and a real number. Supported only in CKKS. -:param ciphertext: Input/output ciphertext +:param ciphertext: input ciphertext :type ciphertext: Ciphertext -:param constant: constant to subtract +:param constant: a real number :type constant: float -:return: ciphertext contains ciphertext - constant )pbdoc"; // EvalSubMutable const char* cc_EvalSubMutable_docs = R"pbdoc( -EvalSub - OpenFHE EvalSubMutable method for a pair of ciphertexts. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced. +Homomorphic subtraction of two mutable ciphertexts -:param ct1: first ciphertext -:type ct1: Ciphertext -:param ct2: second ciphertext -:type ct2: Ciphertext -:return: new ciphertext for ct1 - ct2 +:param ciphertext1: minuend +:type ciphertext1: Ciphertext +:param ciphertext2: subtrahend +:type ciphertext2: Ciphertext +:return: the result as a new ciphertext )pbdoc"; // EvalSubMutableInPlace const char* cc_EvalSubMutableInPlace_docs = R"pbdoc( - EvalSub - Inplace variant for EvalSubMutable. + In-place homomorphic subtraction of two mutable ciphertexts - :param ct1: Input/output ciphertext - :type ct1: Ciphertext - :param ct2: Input ciphertext - :type ct2: Ciphertext - :return: ct1 contains ct1 - ct2 + :param ciphertext1: minuend + :type ciphertext1: Ciphertext + :param ciphertext2: subtrahend + :type ciphertext2: Ciphertext + :return: the updated minuend )pbdoc"; // EvalSubMutablePlaintext const char* cc_EvalSubMutablePlaintext_docs = R"pbdoc( -EvalSub - OpenFHE EvalSubMutable method for a ciphertext and plaintext. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced. +Homomorphic subtraction of mutable ciphertext and plaintext -:param ciphertext: ciphertext +:param ciphertext: minuend :type ciphertext: Ciphertext -:param plaintext: plaintext +:param plaintext: subtrahend :type plaintext: Plaintext :return: new ciphertext for ciphertext - plaintext )pbdoc"; const char* cc_EvalMult_docs = R"pbdoc( -EvalMult - OpenFHE EvalMult method for a pair of ciphertexts - with key switching +EvalMult - OpenFHE EvalMult method for a pair of ciphertexts (uses a relinearization key from the crypto context) -:param ct1: first ciphertext -:type ct1: Ciphertext -:param ct2: second ciphertext -:type ct2: Ciphertext -:return: new ciphertext for ct1 * ct2 +:param ciphertext1: multiplier +:type ciphertext1: Ciphertext +:param ciphertext2: multiplicand +:type ciphertext2: Ciphertext +:return: new ciphertext for ciphertext1 * ciphertext2 :rtype: Ciphertext )pbdoc"; const char* cc_EvalMultfloat_docs = R"pbdoc( -EvalMult - OpenFHE EvalMult method for a ciphertext and constant +Multiplication of a ciphertext by a real number. Supported only in CKKS. -:param ciphertext: the ciphertext +:param ciphertext: multiplier :type ciphertext: Ciphertext -:param constant: constant to multiply +:param constant: multiplicand :type constant: float -:return: new ciphertext for ciphertext * constant +:return: the result of multiplication :rtype: Ciphertext )pbdoc"; const char* cc_EvalMultPlaintext_docs = R"pbdoc( -EvalMult - OpenFHE EvalMult method for a ciphertext and plaintext +Multiplication of a ciphertext by a plaintext -:param ciphertext: the ciphertext +:param ciphertext: multiplier :type ciphertext: Ciphertext -:param plaintext: the plaintext +:param plaintext: multiplicand :type plaintext: Plaintext -:return: new ciphertext for ciphertext * plaintext +:return: the result of multiplication :rtype: Ciphertext )pbdoc"; const char* cc_EvalMultMutable_docs = R"pbdoc( -EvalMult - OpenFHE EvalMultMutable method for a pair of ciphertexts. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced. +EvalMult - OpenFHE EvalMult method for a pair of mutable ciphertexts (uses a relinearization key from the crypto context) -:param ct1: first ciphertext -:type ct1: Ciphertext -:param ct2: second ciphertext -:type ct2: Ciphertext -:return: new ciphertext for ct1 * ct2 +:param ciphertext1: multiplier +:type ciphertext1: Ciphertext +:param ciphertext2: multiplicand +:type ciphertext2: Ciphertext +:return: new ciphertext for ciphertext1 * ciphertext2 :rtype: Ciphertext )pbdoc"; const char* cc_EvalMultMutablePlaintext_docs = R"pbdoc( -EvalMult - OpenFHE EvalMultMutable method for a ciphertext and plaintext. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced. - -:param ciphertext: the ciphertext +Multiplication of mutable ciphertext and plaintext +:param ciphertext: multiplier :type ciphertext: Ciphertext -:param plaintext: the plaintext +:param plaintext: multiplicand :type plaintext: Plaintext -:return: new ciphertext for ciphertext * plaintext +:return: the result of multiplication :rtype: Ciphertext )pbdoc"; const char* cc_EvalMultMutableInPlace_docs = R"pbdoc( - 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. + In-place EvalMult method for a pair of mutable ciphertexts (uses a relinearization key from the crypto context) - :param ct1: Input/output ciphertext - :type ct1: Ciphertext - :param ct2: Input cipherext - :type ct2: Ciphertext - :return: ct1 contains ct1 * ct2 + :param ciphertext1: multiplier + :type ciphertext1: Ciphertext + :param ciphertext2: multiplicand + :type ciphertext2: Ciphertext )pbdoc"; const char* cc_EvalSquare_docs = R"pbdoc( - EvalSquare - OpenFHE EvalSquare method for a ciphertext + Efficient homomorphic squaring of a ciphertext - uses a relinearization key stored in the crypto context - :param ct: the ciphertext to square - :type ct: Ciphertext - :return: new ciphertext for ct^2 = ct * ct + :param ciphertext: input ciphertext + :type ciphertext: Ciphertext + :return: squared ciphertext :rtype: Ciphertext )pbdoc"; const char* cc_EvalSquareMutable_docs = R"pbdoc( - EvalSquare - OpenFHE EvalSquareMutable method for a ciphertext. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced. + Efficient homomorphic squaring of a mutable ciphertext - uses a relinearization key stored in the crypto context - :param ct: the ciphertext to square - :type ct: Ciphertext - :return: new ciphertext for ct^2 = ct * ct + :param ciphertext: input ciphertext + :type ciphertext: Ciphertext + :return: squared ciphertext :rtype: Ciphertext )pbdoc"; const char* cc_EvalSquareInPlace_docs = R"pbdoc( - EvalSquare - OpenFHE EvalSquare method for a ciphertext. This is a mutable version - input ciphertexts may get automatically rescaled, or level-reduced. + In-place homomorphic squaring of a mutable ciphertext - uses a relinearization key stored in the crypto context - :param ct: Input/output ciphertext - :type ct: Ciphertext - :return: ct contains ct^2 = ct * ct + :param ciphertext: input ciphertext + :type ciphertext: Ciphertext + :return: squared ciphertext )pbdoc"; const char* cc_EvalMultNoRelin_docs = R"pbdoc( - EvalMultNoRelin - OpenFHE EvalMult method for a pair of ciphertexts - no key switching (relinearization) + Homomorphic multiplication of two ciphertexts without relinearization - :param ct1: first ciphertext - :type ct1: Ciphertext - :param ct2: second ciphertext - :type ct2: Ciphertext - :return: new ciphertext for ct1 * ct2 + :param ciphertext1: multiplier + :type ciphertext1: Ciphertext + :param ciphertext2: multiplicand + :type ciphertext2: Ciphertext + :return: new ciphertext for ciphertext1 * ciphertext2 :rtype: Ciphertext )pbdoc"; const char* cc_Relinearize_docs = R"pbdoc( - Function for relinearization of a ciphertext. + Homomorphic multiplication of two ciphertexts withour relinearization - :param ct: input ciphertext - :type ct: Ciphertext - :return: relienarized ciphertext + :param ciphertext: input ciphertext + :type ciphertext: Ciphertext + :return: relinearized ciphertext :rtype: Ciphertext )pbdoc"; const char* cc_RelinearizeInPlace_docs = R"pbdoc( - Function for inplace relinearization of a ciphertext. + In-place relinearization of a ciphertext to the lowest level (with 2 polynomials per ciphertext). - :param ct: input/output ciphertext - :type ct: Ciphertext - :return: ct contains relienarized ciphertext + :param ciphertext: input ciphertext + :type ciphertext: Ciphertext )pbdoc"; const char* cc_EvalMultAndRelinearize_docs = R"pbdoc( - 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 + Homomorphic multiplication of two ciphertexts followed by relinearization to the lowest level - :param ct1: first input ciphertext - :type ct1: Ciphertext - :param ct2: second input ciphertext - :type ct2: Ciphertext + :param ciphertext1: first input ciphertext + :type ciphertext1: Ciphertext + :param ciphertext2: second input ciphertext + :type ciphertext2: Ciphertext :return: new ciphertext :rtype: Ciphertext )pbdoc"; const char* cc_EvalNegate_docs = R"pbdoc( - EvalSub - OpenFHE Negate method for a ciphertext + Negates a ciphertext - :param ct: input ciphertext - :type ct: Ciphertext - :return: new ciphertext -ct + :param ciphertext: input ciphertext + :type ciphertext: Ciphertext + :return: new ciphertext: -ciphertext :rtype: Ciphertext )pbdoc"; const char* cc_EvalNegateInPlace_docs = R"pbdoc( - EvalSub - Inplace OpenFHE Negate method for a ciphertext + In-place negation of a ciphertext - :param ct: input/output ciphertext - :type ct: Ciphertext - :return: ct contains -ct + :param ciphertext: input ciphertext + :type ciphertext: Ciphertext )pbdoc"; const char* cc_EvalChebyshevSeries_docs = R"pbdoc( - 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. + 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 (naive linear method), otherwise, use EvalChebyshevSeriesPS (Paterson-Stockmeyer method). Supported only in CKKS. :param ciphertext: input ciphertext :type ciphertext: Ciphertext - :param coefficients: list of coefficients in Chebyshev expansion + :param coefficients: is the vector of coefficients in Chebyshev expansion :type coefficients: list :param a: lower bound of argument for which the coefficients were found :type a: float @@ -665,11 +659,11 @@ const char* cc_EvalChebyshevSeries_docs = R"pbdoc( )pbdoc"; const char* cc_EvalChebyshevSeriesLinear_docs = R"pbdoc( - Evaluate Chebyshev polynomial of degree less than 5. + Naive linear 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). Supported only in CKKS. :param ciphertext: input ciphertext :type ciphertext: Ciphertext - :param coefficients: list of coefficients in Chebyshev expansion + :param coefficients: is the vector of coefficients in Chebyshev expansion :type coefficients: list :param a: lower bound of argument for which the coefficients were found :type a: float @@ -680,11 +674,11 @@ const char* cc_EvalChebyshevSeriesLinear_docs = R"pbdoc( )pbdoc"; const char* cc_EvalChebyshevSeriesPS_docs = R"pbdoc( - Evaluate Chebyshev polynomial of degree greater or equal to 5. + Paterson-Stockmeyer 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). Supported only in CKKS. :param ciphertext: input ciphertext :type ciphertext: Ciphertext - :param coefficients: list of coefficients in Chebyshev expansion + :param coefficients: is the vector of coefficients in Chebyshev expansion :type coefficients: list :param a: lower bound of argument for which the coefficients were found :type a: float @@ -695,7 +689,7 @@ const char* cc_EvalChebyshevSeriesPS_docs = R"pbdoc( )pbdoc"; const char* cc_EvalChebyshevFunction_docs = R"pbdoc( - Method for calculating Chebyshev evaluation on a ciphertext for a smooth input function over the range [a,b]. + Method for calculating Chebyshev evaluation on a ciphertext for a smooth input function over the range [a,b]. Supported only in CKKS. :param func: the function to be approximated :type func: function @@ -712,7 +706,7 @@ const char* cc_EvalChebyshevFunction_docs = R"pbdoc( )pbdoc"; const char* cc_EvalSin_docs = R"pbdoc( - Evaluate approximate sine function on a ciphertext using the Chebyshev approximation. + Evaluate approximate sine function on a ciphertext using the Chebyshev approximation. Supported only in CKKS. :param ciphertext: input ciphertext :type ciphertext: Ciphertext @@ -727,7 +721,7 @@ const char* cc_EvalSin_docs = R"pbdoc( )pbdoc"; const char* cc_EvalCos_docs = R"pbdoc( - Evaluate approximate cosine function on a ciphertext using the Chebyshev approximation. + Evaluate approximate cosine function on a ciphertext using the Chebyshev approximation. Supported only in CKKS. :param ciphertext: input ciphertext :type ciphertext: Ciphertext @@ -742,7 +736,7 @@ const char* cc_EvalCos_docs = R"pbdoc( )pbdoc"; const char* cc_EvalLogistic_docs = R"pbdoc( - Evaluate approximate logistic function 1/(1 + exp(-x)) on a ciphertext using the Chebyshev approximation. + Evaluate approximate logistic function 1/(1 + exp(-x)) on a ciphertext using the Chebyshev approximation. Supported only in CKKS. :param ciphertext: input ciphertext :type ciphertext: Ciphertext @@ -757,7 +751,7 @@ const char* cc_EvalLogistic_docs = R"pbdoc( )pbdoc"; const char* cc_EvalDivide_docs = R"pbdoc( - Evaluate approximate division function 1/x where x >= 1 on a ciphertext using the Chebyshev approximation. + Evaluate approximate division function 1/x where x >= 1 on a ciphertext using the Chebyshev approximation. Supported only in CKKS. :param ciphertext: input ciphertext :type ciphertext: Ciphertext @@ -772,7 +766,7 @@ const char* cc_EvalDivide_docs = R"pbdoc( )pbdoc"; const char* cc_EvalSumKeyGen_docs = R"pbdoc( - EvalSumKeyGen generates the key map to be used by evalsum + EvalSumKeyGen Generates the key map to be used by EvalSum :param privateKey: private key :type privateKey: PrivateKey @@ -782,57 +776,61 @@ const char* cc_EvalSumKeyGen_docs = R"pbdoc( )pbdoc"; const char* cc_EvalSumRowsKeyGen_docs = R"pbdoc( - EvalSumRowsKeyGen generates the key map to be used by EvalSumRows + Generate the automorphism keys for EvalSumRows; works only for packed encoding :param privateKey: private key :type privateKey: PrivateKey - :param publicKey: public key (used in NTRU schemes) + :param publicKey: public key :type publicKey: PublicKey - :param rowSize: number of rows + :param rowSize: size of rows in the matrix :type rowSize: int - :param subringDim: dimension of the subring + :param subringDim: subring dimension (set to cyclotomic order if set to 0) :type subringDim: int - :return: dict: Evaluation key map, where the keys being integer indexes and values being EvalKey objects + :return: returns the evaluation keys + :rtype: EvalKeyMap )pbdoc"; const char* cc_EvalSumColsKeyGen_docs = R"pbdoc( - EvalSumColsKeyGen generates the key map to be used by EvalSumCols + Generates the automorphism keys for EvalSumCols; works only for packed encoding :param privateKey: private key :type privateKey: PrivateKey - :param publicKey: public key (used in NTRU schemes) + :param publicKey: public key :type publicKey: PublicKey - :return: dict: Evaluation key map, where the keys being integer indexes and values being EvalKey objects + :return: returns the evaluation keys + :rtype: EvalKeyMap )pbdoc"; const char* cc_EvalSumRows_docs = R"pbdoc( + Sums all elements over row-vectors in a matrix - works only with packed encoding - :param ciphertext: input ciphertext + :param ciphertext: the input ciphertext :type ciphertext: Ciphertext - :param rowSize: number of rows + :param rowSize: size of rows in the matrix :type rowSize: int - :param evalSumKeyMap: evaluation key map, where the keys being integer indexes and values being EvalKey objects - :type evalSumKeyMap: dict - :param subringDim: dimension of the subring + :param evalSumKeyMap: reference to the map of evaluation keys generated by + :type evalSumKeyMap: EvalKeyMap + :param subringDim: the current cyclotomic order/subring dimension. If set to 0, we use the full cyclotomic order. :type subringDim: int :return: Ciphertext: resulting ciphertext :rtype: Ciphertext )pbdoc"; const char* cc_EvalSumCols_docs = R"pbdoc( + Sums all elements over column-vectors in a matrix - works only with packed encoding - :param ciphertext: input ciphertext + :param ciphertext: the input ciphertext :type ciphertext: Ciphertext - :param rowSize: number of rows + :param rowSize: size of rows in the matrix :type rowSize: int - :param evalSumKeyMap: evaluation key map, where the keys being integer indexes and values being EvalKey objects - :type evalSumKeyMap: dict + :param evalSumKeyMap: reference to the map of evaluation keys generated by + :type evalSumKeyMap: EvalKeyMap :return: Ciphertext: resulting ciphertext :rtype: Ciphertext )pbdoc"; const char* cc_EvalInnerProduct_docs = R"pbdoc( - Evaluates inner product in batched encoding + Evaluates inner product in packed encoding (uses EvalSum) :param ciphertext1: first vector :type ciphertext1: Ciphertext @@ -845,7 +843,7 @@ const char* cc_EvalInnerProduct_docs = R"pbdoc( )pbdoc"; const char* cc_EvalInnerProductPlaintext_docs = R"pbdoc( - Evaluates inner product in batched encoding + Evaluates inner product in packed encoding (uses EvalSum) :param ciphertext: first vector - ciphertext :type ciphertext: Ciphertext @@ -875,10 +873,10 @@ const char* cc_MultipartyDecryptLead_docs = R"pbdoc( :param ciphertextVec: a list of ciphertexts :type ciphertextVec: list - :param privateKey: secret key share used for decryption. list of partially decrypted ciphertexts. + :param privateKey: secret key share used for decryption. :type privateKey: PrivateKey - :return: Ciphertext: resulting ciphertext - :rtype: Ciphertext + :return: list of partially decrypted ciphertexts. + :rtype: List[Ciphertext] )pbdoc"; const char* cc_MultipartyDecryptMain_docs = R"pbdoc( @@ -886,10 +884,10 @@ const char* cc_MultipartyDecryptMain_docs = R"pbdoc( :param ciphertextVec: a list of ciphertexts :type ciphertextVec: list - :param privateKey: secret key share used for decryption. list of partially decrypted ciphertexts. + :param privateKey: secret key share used for decryption. :type privateKey: PrivateKey - :return: Ciphertext: resulting ciphertext - :rtype: Ciphertext + :return: list of partially decrypted ciphertexts. + :rtype: List[Ciphertext] )pbdoc"; const char* cc_MultipartyDecryptFusion_docs = R"pbdoc( @@ -915,19 +913,103 @@ const char* cc_MultiKeySwitchGen_docs = R"pbdoc( )pbdoc"; // TODO (Oliveira, R.) - Complete the following documentation -const char* cc_GetEvalSumKeyMap_docs = ""; -const char* cc_InsertEvalSumKey_docs = ""; -const char* cc_MultiEvalSumKeyGen_docs = ""; -const char* cc_MultiAddEvalKeys_docs = ""; -const char* cc_MultiMultEvalKey_docs = ""; -const char* cc_MultiAddEvalSumKeys_docs = ""; -const char* cc_MultiAddEvalMultKeys_docs = ""; -const char* cc_InsertEvalMultKey_docs = ""; -const char* cc_EvalSum_docs = ""; +const char* cc_GetEvalSumKeyMap_docs = R"pbdoc( + Get a map of summation keys (each is composed of several automorphism keys) for a specific secret key tag + :return: EvalKeyMap: key map + :rtype: EvalKeyMap +)pbdoc"; +const char* cc_InsertEvalSumKey_docs = R"pbdoc( + InsertEvalSumKey - add the given map of keys to the map, replacing the existing map if there + + :param evalKeyMap: key map + :type evalKeyMap: EvalKeyMap +)pbdoc"; +const char* cc_MultiEvalSumKeyGen_docs = R"pbdoc( + Threshold FHE: Generates joined summation evaluation keys from the current secret share and prior joined summation keys + + :param privateKey: secret key share + :type privateKey: PrivateKey + :param evalKeyMap: a map with prior joined summation keys + :type evalKeyMap: EvalKeyMap + :param keyId: new key identifier used for resulting evaluation key + :type keyId: str + :return: EvalKeyMap: new joined summation keys + :rtype: EvalKeyMap +)pbdoc"; + +const char* cc_MultiAddEvalKeys_docs = R"pbdoc( + Threshold FHE: Adds two prior evaluation keys + + :param evalKey1: first evaluation key + :type evalKey1: EvalKey + :param evalKey2: second evaluation key + :type evalKey2: EvalKey + :param keyId: new key identifier used for resulting evaluation key + :type keyId: str + :return: the new joined key + :rtype: EvalKey +)pbdoc"; + +const char* cc_MultiMultEvalKey_docs = R"pbdoc( + Threshold FHE: Generates a partial evaluation key for homomorphic multiplication based on the current secret share and an existing partial evaluation key + + :param privateKey: current secret share + :type privateKey: PrivateKey + :param evalKey: prior evaluation key + :type evalKey: EvalKey + :param keyId: new key identifier used for resulting evaluation key + :type keyId: str + :return: the new joined key + :rtype: EvalKey +)pbdoc"; + +const char* cc_MultiAddEvalSumKeys_docs = R"pbdoc( + Threshold FHE: Adds two prior evaluation key sets for summation + + :param evalKeyMap1: first summation key set + :type evalKeyMap1: EvalKeyMap + :param evalKeyMap2: second summation key set + :type evalKeyMap2: EvalKeyMap + :param keyId: new key identifier used for resulting evaluation key + :type keyId: str + :return: the neew joined key set for summation + :rtype: EvalKeyMap +)pbdoc"; + +const char* cc_MultiAddEvalMultKeys_docs = R"pbdoc( + Threshold FHE: Adds two prior evaluation key sets for summation + + :param evalKey1: first evaluation key + :type evalKey1: EvalKey + :param evalKey2: second evaluation key + :type evalKey2: EvalKey + :param keyId: new key identifier used for resulting evaluation key + :type keyId: str + :return: the new joined key + :rtype: EvalKey +)pbdoc"; + +const char* cc_InsertEvalMultKey_docs = R"pbdoc( + InsertEvalMultKey - add the given vector of keys to the map, replacing the existing vector if there + + :param evalKeyVec: vector of keys + :type evalKeyVec: List[EvalKey] +)pbdoc"; + +const char* cc_EvalSum_docs = R"pbdoc( + Function for evaluating a sum of all components in a vector. + + :param ciphertext: the input ciphertext + :type ciphertext: Ciphertext + :param batchSize: size of the batch + :type batchSize: int + :return: resulting ciphertext + :rtype: Ciphertext +)pbdoc"; const char* cc_EvalMerge_docs = R"pbdoc( - Merges multiple ciphertexts with encrypted results in slot 0 into a single ciphertext The slot assignment is done based on the order of ciphertexts in the vector + Merges multiple ciphertexts with encrypted results in slot 0 into a single ciphertext. The slot assignment is done based on the order of ciphertexts in the vector. Requires the generation of rotation keys for the indices that are needed. :param ciphertextVec: vector of ciphertexts to be merged. :type ciphertextVec: list @@ -947,21 +1029,22 @@ const char* cc_EvalPoly_docs = R"pbdoc( )pbdoc"; const char* cc_EvalPolyLinear_docs = R"pbdoc( - Method for polynomial evaluation for polynomials represented in the power series. This uses EvalPolyLinear, which uses a binary tree computation of the polynomial powers. + Naive method for polynomial evaluation for polynomials represented in the power series (fast only for small-degree polynomials; less than 10). Uses a binary tree computation of the polynomial powers. Supported only in CKKS. :param ciphertext: input ciphertext :type ciphertext: Ciphertext - :param coefficients: vector of coefficients in the polynomial; the size of the vector is the degree of the polynomial + :param coefficients: is the vector of coefficients in the polynomial; the size of the vector is the degree of the polynomial :type coefficients: list :return: Ciphertext: the result of polynomial evaluation. :rtype: Ciphertext )pbdoc"; const char* cc_EvalPolyPS_docs = R"pbdoc( + Paterson-Stockmeyer method for evaluation for polynomials represented in the power series. Supported only in CKKS. :param ciphertext: input ciphertext :type ciphertext: Ciphertext - :param coefficients: vector of coefficients in the polynomial; the size of the vector is the degree of the polynomial + :param coefficients: is the vector of coefficients in the polynomial; the size of the vector is the degree of the polynomial :type coefficients: list :return: Ciphertext: the result of polynomial evaluation. :rtype: Ciphertext @@ -972,14 +1055,14 @@ const char* cc_Rescale_docs = R"pbdoc( :param ciphertext: ciphertext :type ciphertext: Ciphertext - :return: Ciphertext: mod reduced ciphertext + :return: Ciphertext: rescaled ciphertext :rtype: Ciphertext )pbdoc"; const char* cc_RescaleInPlace_docs = R"pbdoc( - RescaleInPlace - An alias for OpenFHE ModReduceInPlace method. This is because ModReduceInPlace is called RescaleInPlace in CKKS. + Rescale - An alias for OpenFHE ModReduceInPlace method. This is because ModReduceInPlace is called RescaleInPlace in CKKS. - :param ciphertext: ciphertext + :param ciphertext: ciphertext to be rescaled in-place :type ciphertext: Ciphertext )pbdoc"; @@ -1006,7 +1089,7 @@ const char* cc_EvalBootstrapSetup_docs = R"pbdoc( 2. EvalBootstrapKeyGen: computes and stores the keys for rotations and conjugation - 3. EvalBootstrap: refreshes the given ciphertext Sets all parameters for the linear method for the FFT-like method + 3. EvalBootstrap: refreshes the given ciphertext Sets all parameters for both linear and FTT-like methods. Supported in CKKS only. :param levelBudget: vector of budgets for the amount of levels in encoding and decoding :type levelBudget: list @@ -1014,13 +1097,13 @@ const char* cc_EvalBootstrapSetup_docs = R"pbdoc( :type dim1: list :param slots: number of slots to be bootstraped :type slots: int - :param correctionFactor: alue to rescale message by to improve precision. If set to 0, we use the default logic. This value is only used when get_native_int()=64 + :param correctionFactor: value to internally rescale message by to improve precision of bootstrapping. If set to 0, we use the default logic. This value is only used when NATIVE_SIZE=64. :type correctionFactor: int :return: None )pbdoc"; const char* cc_EvalBootstrapKeyGen_docs = R"pbdoc( - Generates all automorphism keys for EvalBT. EvalBootstrapKeyGen uses the baby-step/giant-step strategy. + Generates all automorphism keys for EvalBootstrap. Supported in CKKS only. EvalBootstrapKeyGen uses the baby-step/giant-step strategy. :param privateKey: private key. :type privateKey: PrivateKey @@ -1049,39 +1132,37 @@ const char* cc_EvalAutomorphismKeyGen_docs = R"pbdoc( :type privateKey: PrivateKey :param indexList: list of automorphism indices to be computed. :type indexList: list - :return: dict: returns the evaluation key + :return: returns the evaluation key + :rtype: EvalKeyMap )pbdoc"; const char* cc_EvalAutomorphismKeyGenPublic_docs = R"pbdoc( - Generate automophism keys for a given private key. - - :param publicKey: original public key. - :type publicKey: PublicKey - :param privateKey: original private key. - :type privateKey: PrivateKey - :param indexList: list of automorphism indices to be computed. - :type indexList: list - :return: dict: returns the evaluation keys; index 0 of the vector corresponds to plaintext index 2, index 1 to plaintex index 3, etc. + NOT USED BY ANY CRYPTO SCHEME: Generate automophism keys for a public and private key )pbdoc"; const char* cc_FindAutomorphismIndex_docs = R"pbdoc( - Find the automorphism index for a given plaintext index + Finds an automorphism index for a given vector index using a scheme-specific algorithm - :param idx: plaintext index + :param idx: regular vector index :type idx: int - :return: int: automorphism index + :return: the automorphism index + :rtype: int )pbdoc"; const char* cc_FindAutomorphismIndices_docs = R"pbdoc( - Find the automorphism indices for a given list of plaintext indices + Finds automorphism indices for a given list of vector indices using a scheme-specific algorithm - :param idxList: list of plaintext indices - :type idxList: list - :return: list: list of automorphism indices + :param idxList: list of indices + :type idxList: List[int] + :return: a list of automorphism indices + :rtype: List[int] )pbdoc"; const char* cc_ClearEvalMultKeys_docs = R"pbdoc( - ClearEvalMultKeys - flush EvalMultKey cache + ClearEvalMultKeys - flush EvalMultKey cache for a given id + + :param id: the corresponding key id + :type id: str )pbdoc"; const char* cc_ClearEvalAutomorphismKeys_docs = R"pbdoc( @@ -1103,13 +1184,13 @@ const char* cc_SerializeEvalAutomorphismKey_docs = R"pbdoc( const char* cc_SerializeEvalMultKey_docs = R"pbdoc( SerializeEvalMultKey for a single EvalMult key or all of the EvalMult keys - :param filename: output file + :param filename: output file to serialize to :type filename: str :param sertype: type of serialization :type sertype: SERJSON, SERBINARY :param id: for key to serialize - if empty string, serialize them all :type id: str - :return: bool: true on success + :return: bool: true on success (false on failure or no keys found) )pbdoc"; const char* cc_DeserializeEvalAutomorphismKey_docs = R"pbdoc( diff --git a/src/lib/bindings.cpp b/src/lib/bindings.cpp index 5ef14ba..6019987 100644 --- a/src/lib/bindings.cpp +++ b/src/lib/bindings.cpp @@ -130,12 +130,12 @@ void bind_crypto_context(py::module &m) .def("MakePackedPlaintext", &CryptoContextImpl::MakePackedPlaintext, cc_MakePackedPlaintext_docs, py::arg("value"), - py::arg("depth") = 1, + py::arg("noiseScaleDeg") = 1, py::arg("level") = 0) .def("MakeCoefPackedPlaintext", &CryptoContextImpl::MakeCoefPackedPlaintext, cc_MakeCoefPackedPlaintext_docs, py::arg("value"), - py::arg("depth") = 1, + py::arg("noiseScaleDeg ") = 1, py::arg("level") = 0) // TODO (Oliveira): allow user to specify different params values .def("MakeCKKSPackedPlaintext", static_cast::*)(const std::vector<std::complex<double>> &, size_t, uint32_t, const std::shared_ptr<ParmType>, usint) const>(&CryptoContextImpl<DCRTPoly>::MakeCKKSPackedPlaintext), cc_MakeCKKSPackedPlaintextComplex_docs, @@ -204,7 +204,7 @@ void bind_crypto_context(py::module &m) (&CryptoContextImpl<DCRTPoly>::EvalAdd), cc_EvalAddfloat_docs, py::arg("ciphertext"), - py::arg("scalar")) + py::arg("constant")) .def("EvalAddInPlace", static_cast<void (CryptoContextImpl<DCRTPoly>::*)(Ciphertext<DCRTPoly> &, ConstCiphertext<DCRTPoly>) const> (&CryptoContextImpl<DCRTPoly>::EvalAddInPlace), cc_EvalAddInPlace_docs, @@ -223,8 +223,8 @@ void bind_crypto_context(py::module &m) .def("EvalAddMutable", static_cast<Ciphertext<DCRTPoly> (CryptoContextImpl<DCRTPoly>::*)(Ciphertext<DCRTPoly> &, Ciphertext<DCRTPoly> &) const> (&CryptoContextImpl<DCRTPoly>::EvalAddMutable), cc_EvalAddMutable_docs, - py::arg("ct1"), - py::arg("ct2")) + py::arg("ciphertext1"), + py::arg("ciphertext2")) .def("EvalAddMutable", static_cast<Ciphertext<DCRTPoly> (CryptoContextImpl<DCRTPoly>::*)(Ciphertext<DCRTPoly> &, Plaintext) const> (&CryptoContextImpl<DCRTPoly>::EvalAddMutable), cc_EvalAddMutablePlaintext_docs, @@ -242,8 +242,8 @@ void bind_crypto_context(py::module &m) .def("EvalSub", static_cast<Ciphertext<DCRTPoly> (CryptoContextImpl<DCRTPoly>::*)(ConstCiphertext<DCRTPoly>, ConstCiphertext<DCRTPoly>) const> (&CryptoContextImpl<DCRTPoly>::EvalSub), cc_EvalSub_docs, - py::arg("ct1"), - py::arg("ct2")) + py::arg("ciphertext1"), + py::arg("ciphertext2")) .def("EvalSub", static_cast<Ciphertext<DCRTPoly> (CryptoContextImpl<DCRTPoly>::*)(ConstCiphertext<DCRTPoly>, double) const> (&CryptoContextImpl<DCRTPoly>::EvalSub), cc_EvalSubfloat_docs, @@ -267,8 +267,8 @@ void bind_crypto_context(py::module &m) .def("EvalSubInPlace", static_cast<void (CryptoContextImpl<DCRTPoly>::*)(Ciphertext<DCRTPoly> &, ConstCiphertext<DCRTPoly>) const> (&CryptoContextImpl<DCRTPoly>::EvalSubInPlace), cc_EvalSubInPlace_docs, - py::arg("ct1"), - py::arg("ct2")) + py::arg("ciphertext1"), + py::arg("ciphertext2")) .def("EvalSubInPlace", static_cast<void (CryptoContextImpl<DCRTPoly>::*)(Ciphertext<DCRTPoly> &, double) const> (&CryptoContextImpl<DCRTPoly>::EvalSubInPlace), cc_EvalSubInPlacefloat_docs, @@ -282,8 +282,8 @@ void bind_crypto_context(py::module &m) .def("EvalSubMutable", static_cast<Ciphertext<DCRTPoly> (CryptoContextImpl<DCRTPoly>::*)(Ciphertext<DCRTPoly> &, Ciphertext<DCRTPoly> &) const> (&CryptoContextImpl<DCRTPoly>::EvalSubMutable), cc_EvalSubMutable_docs, - py::arg("ct1"), - py::arg("ct2")) + py::arg("ciphertext1"), + py::arg("ciphertext2")) .def("EvalSubMutable", static_cast<Ciphertext<DCRTPoly> (CryptoContextImpl<DCRTPoly>::*)(Ciphertext<DCRTPoly> &, Plaintext) const> (&CryptoContextImpl<DCRTPoly>::EvalSubMutable), cc_EvalSubMutablePlaintext_docs, @@ -301,8 +301,8 @@ void bind_crypto_context(py::module &m) .def("EvalMult", static_cast<Ciphertext<DCRTPoly> (CryptoContextImpl<DCRTPoly>::*)(ConstCiphertext<DCRTPoly>, ConstCiphertext<DCRTPoly>) const> (&CryptoContextImpl<DCRTPoly>::EvalMult), cc_EvalMult_docs, - py::arg("ct1"), - py::arg("ct2")) + py::arg("ciphertext1"), + py::arg("ciphertext2")) .def("EvalMult", static_cast<Ciphertext<DCRTPoly> (CryptoContextImpl<DCRTPoly>::*)(ConstCiphertext<DCRTPoly>, double) const> (&CryptoContextImpl<DCRTPoly>::EvalMult), cc_EvalMultfloat_docs, @@ -326,8 +326,8 @@ void bind_crypto_context(py::module &m) .def("EvalMultMutable", static_cast<Ciphertext<DCRTPoly> (CryptoContextImpl<DCRTPoly>::*)(Ciphertext<DCRTPoly> &, Ciphertext<DCRTPoly> &) const> (&CryptoContextImpl<DCRTPoly>::EvalMultMutable), cc_EvalMultMutable_docs, - py::arg("ct1"), - py::arg("ct2")) + py::arg("ciphertext1"), + py::arg("ciphertext2")) .def("EvalMultMutable", static_cast<Ciphertext<DCRTPoly> (CryptoContextImpl<DCRTPoly>::*)(Ciphertext<DCRTPoly> &, Plaintext) const> (&CryptoContextImpl<DCRTPoly>::EvalMultMutable), cc_EvalMultMutablePlaintext_docs, @@ -340,21 +340,21 @@ void bind_crypto_context(py::module &m) py::arg("ciphertext")) .def("EvalMultMutableInPlace", &CryptoContextImpl<DCRTPoly>::EvalMultMutableInPlace, cc_EvalMultMutableInPlace_docs, - py::arg("ct1"), - py::arg("ct2")) + py::arg("ciphertext1"), + py::arg("ciphertext2")) .def("EvalSquare", &CryptoContextImpl<DCRTPoly>::EvalSquare, cc_EvalSquare_docs, - py::arg("ct")) + py::arg("ciphertext")) .def("EvalSquareMutable", &CryptoContextImpl<DCRTPoly>::EvalSquareMutable, cc_EvalSquareMutable_docs, - py::arg("ct")) + py::arg("ciphertext")) .def("EvalSquareInPlace", &CryptoContextImpl<DCRTPoly>::EvalSquareInPlace, cc_EvalSquareInPlace_docs, - py::arg("ct")) + py::arg("ciphertext")) .def("EvalMultNoRelin", &CryptoContextImpl<DCRTPoly>::EvalMultNoRelin, cc_EvalMultNoRelin_docs, - py::arg("ct1"), - py::arg("ct2")) + py::arg("ciphertext1"), + py::arg("ciphertext2")) .def("Relinearize", &CryptoContextImpl<DCRTPoly>::Relinearize, cc_Relinearize_docs, py::arg("ciphertext")) @@ -363,14 +363,14 @@ void bind_crypto_context(py::module &m) py::arg("ciphertext")) .def("EvalMultAndRelinearize", &CryptoContextImpl<DCRTPoly>::EvalMultAndRelinearize, cc_EvalMultAndRelinearize_docs, - py::arg("ct1"), - py::arg("ct2")) + py::arg("ciphertext1"), + py::arg("ciphertext2")) .def("EvalNegate", &CryptoContextImpl<DCRTPoly>::EvalNegate, cc_EvalNegate_docs, - py::arg("ct")) + py::arg("ciphertext")) .def("EvalNegateInPlace", &CryptoContextImpl<DCRTPoly>::EvalNegateInPlace, cc_EvalNegateInPlace_docs, - py::arg("ct")) + py::arg("ciphertext")) .def("EvalLogistic", &CryptoContextImpl<DCRTPoly>::EvalLogistic, cc_EvalLogistic_docs, py::arg("ciphertext"),