Hovsep Papoyan 5 месяцев назад
Родитель
Сommit
3894d7c19a

+ 4 - 4
examples/function_evaluation.rs

@@ -5,7 +5,7 @@ use openfhe::ffi as ffi;
 fn EvalLogisticExample()
 {
     println!("--------------------------------- EVAL LOGISTIC FUNCTION ---------------------------------");
-    let mut _cc_params_ckksrns = ffi::GetParamsCKKSRNS();
+    let mut _cc_params_ckksrns = ffi::GenParamsCKKSRNS();
     _cc_params_ckksrns.pin_mut().SetSecurityLevel(ffi::SecurityLevel::HEStd_NotSet);
     _cc_params_ckksrns.pin_mut().SetRingDim(1 << 10);
     // #if NATIVEINT == 128
@@ -45,7 +45,7 @@ fn EvalLogisticExample()
     let _upper_bound: f64 = 5.0;
     let _result = _cc.EvalLogistic(&_cipher_text, _lower_bound, _upper_bound, _poly_degree);
 
-    let mut _plain_text_dec = ffi::GenEmptyPlainText();
+    let mut _plain_text_dec = ffi::GenNullPlainText();
     _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_result, _plain_text_dec.pin_mut());
     _plain_text_dec.SetLength(_encoded_length);
 
@@ -73,7 +73,7 @@ fn GetSqrt(x: f64, ret: &mut f64)
 fn EvalFunctionExample()
 {
     println!("--------------------------------- EVAL SQUARE ROOT FUNCTION ---------------------------------");
-    let mut _cc_params_ckksrns = ffi::GetParamsCKKSRNS();
+    let mut _cc_params_ckksrns = ffi::GenParamsCKKSRNS();
     _cc_params_ckksrns.pin_mut().SetSecurityLevel(ffi::SecurityLevel::HEStd_NotSet);
     _cc_params_ckksrns.pin_mut().SetRingDim(1 << 10);
     // #if NATIVEINT == 128
@@ -113,7 +113,7 @@ fn EvalFunctionExample()
     let _upper_bound: f64 = 10.0;
     let _result = _cc.EvalChebyshevFunction(GetSqrt, &_cipher_text, _lower_bound, _upper_bound, _poly_degree);
 
-    let mut _plain_text_dec = ffi::GenEmptyPlainText();
+    let mut _plain_text_dec = ffi::GenNullPlainText();
     _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_result, _plain_text_dec.pin_mut());
     _plain_text_dec.SetLength(_encoded_length);
 

+ 3 - 3
examples/polynomial_evaluation.rs

@@ -6,7 +6,7 @@ fn main()
     use std::time::Instant;
     println!("\n======EXAMPLE FOR EVALPOLY========\n");
 
-    let mut _cc_params_ckksrns = ffi::GetParamsCKKSRNS();
+    let mut _cc_params_ckksrns = ffi::GenParamsCKKSRNS();
     _cc_params_ckksrns.pin_mut().SetMultiplicativeDepth(6);
     _cc_params_ckksrns.pin_mut().SetScalingModSize(50);
 
@@ -90,10 +90,10 @@ fn main()
     let _result_2 = _cc.EvalPoly(&_cipher_text_1, &_coefficients_2);
     let _time_eval_poly_2 = _start.elapsed();
 
-    let mut _plain_text_dec = ffi::GenEmptyPlainText();
+    let mut _plain_text_dec = ffi::GenNullPlainText();
     _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_result, _plain_text_dec.pin_mut());
     _plain_text_dec.SetLength(_encoded_length);
-    let mut _plain_text_dec_2 = ffi::GenEmptyPlainText();
+    let mut _plain_text_dec_2 = ffi::GenNullPlainText();
     _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_result_2, _plain_text_dec_2.pin_mut());
     _plain_text_dec_2.SetLength(_encoded_length);
 

+ 7 - 7
examples/simple_integers.rs

@@ -3,7 +3,7 @@ use openfhe::ffi as ffi;
 
 fn main()
 {
-    let mut _cc_params_bfvrns = ffi::GetParamsBFVRNS();
+    let mut _cc_params_bfvrns = ffi::GenParamsBFVRNS();
     _cc_params_bfvrns.pin_mut().SetPlaintextModulus(65537);
     _cc_params_bfvrns.pin_mut().SetMultiplicativeDepth(2);
 
@@ -82,17 +82,17 @@ fn main()
     let _cipher_text_rot_3 = _cc.EvalRotate(&_cipher_text_1, -1);
     let _cipher_text_rot_4 = _cc.EvalRotate(&_cipher_text_1, -2);
 
-    let mut _plain_text_add_result = ffi::GenEmptyPlainText();
+    let mut _plain_text_add_result = ffi::GenNullPlainText();
     _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_cipher_text_add_result, _plain_text_add_result.pin_mut());
-    let mut _plain_text_mult_result = ffi::GenEmptyPlainText();
+    let mut _plain_text_mult_result = ffi::GenNullPlainText();
     _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_cipher_text_mult_result, _plain_text_mult_result.pin_mut());
-    let mut _plain_text_rot_1 = ffi::GenEmptyPlainText();
+    let mut _plain_text_rot_1 = ffi::GenNullPlainText();
     _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_cipher_text_rot_1, _plain_text_rot_1.pin_mut());
-    let mut _plain_text_rot_2 = ffi::GenEmptyPlainText();
+    let mut _plain_text_rot_2 = ffi::GenNullPlainText();
     _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_cipher_text_rot_2, _plain_text_rot_2.pin_mut());
-    let mut _plain_text_rot_3 = ffi::GenEmptyPlainText();
+    let mut _plain_text_rot_3 = ffi::GenNullPlainText();
     _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_cipher_text_rot_3, _plain_text_rot_3.pin_mut());
-    let mut _plain_text_rot_4 = ffi::GenEmptyPlainText();
+    let mut _plain_text_rot_4 = ffi::GenNullPlainText();
     _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_cipher_text_rot_4, _plain_text_rot_4.pin_mut());
 
     _plain_text_rot_1.SetLength(_vector_of_ints_1.len());

+ 2 - 2
examples/simple_real_numbers.rs

@@ -7,7 +7,7 @@ fn main()
     let _scale_mod_size: u32 = 50;
     let _batch_size: u32 = 8;
 
-    let mut _cc_params_ckksrns = ffi::GetParamsCKKSRNS();
+    let mut _cc_params_ckksrns = ffi::GenParamsCKKSRNS();
     _cc_params_ckksrns.pin_mut().SetMultiplicativeDepth(_mult_depth);
     _cc_params_ckksrns.pin_mut().SetScalingModSize(_scale_mod_size);
     _cc_params_ckksrns.pin_mut().SetBatchSize(_batch_size);
@@ -62,7 +62,7 @@ fn main()
     let _c_rot_1 = _cc.EvalRotate(&_c1, 1);
     let _c_rot_2 = _cc.EvalRotate(&_c1, -2);
 
-    let mut _result = ffi::GenEmptyPlainText();
+    let mut _result = ffi::GenNullPlainText();
     println!("\nResults of homomorphic computations:");
 
     _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_c1, _result.pin_mut());

+ 1 - 4
src/Ciphertext.cc

@@ -5,9 +5,6 @@
 namespace openfhe
 {
 
-CiphertextDCRTPoly::CiphertextDCRTPoly()
-    : m_ciphertext(std::make_shared<CiphertextImpl>())
-{ }
 CiphertextDCRTPoly::CiphertextDCRTPoly(const std::shared_ptr<CiphertextImpl>& ciphertext)
     : m_ciphertext(ciphertext)
 { }
@@ -15,7 +12,7 @@ std::shared_ptr<CiphertextImpl> CiphertextDCRTPoly::GetInternal() const
 {
     return m_ciphertext;
 }
-std::unique_ptr<CiphertextDCRTPoly> GenDefaultConstructedCiphertext()
+std::unique_ptr<CiphertextDCRTPoly> GenNullCiphertext()
 {
     return std::make_unique<CiphertextDCRTPoly>();
 }

+ 2 - 2
src/Ciphertext.h

@@ -19,7 +19,7 @@ public:
     friend bool DeserializeCiphertextFromFile(const std::string& ciphertextLocation,
         CiphertextDCRTPoly& ciphertext, const SerialMode serialMode);
 
-    explicit CiphertextDCRTPoly();
+    CiphertextDCRTPoly() = default;
     explicit CiphertextDCRTPoly(const std::shared_ptr<CiphertextImpl>& ciphertext);
     CiphertextDCRTPoly(const CiphertextDCRTPoly&) = delete;
     CiphertextDCRTPoly(CiphertextDCRTPoly&&) = delete;
@@ -28,6 +28,6 @@ public:
 
     [[nodiscard]] std::shared_ptr<CiphertextImpl> GetInternal() const;
 };
-[[nodiscard]] std::unique_ptr<CiphertextDCRTPoly> GenDefaultConstructedCiphertext();
+[[nodiscard]] std::unique_ptr<CiphertextDCRTPoly> GenNullCiphertext();
 
 } // openfhe

+ 1 - 1
src/CryptoContext.cc

@@ -945,7 +945,7 @@ std::unique_ptr<std::vector<uint32_t>> GetUniqueValues(const std::vector<uint32_
     return std::make_unique<std::vector<uint32_t>>(CryptoContextImpl::GetUniqueValues(oldValues,
         newValues));
 }
-std::unique_ptr<CryptoContextDCRTPoly> GenEmptyCryptoContext()
+std::unique_ptr<CryptoContextDCRTPoly> GenNullCryptoContext()
 {
     return std::make_unique<CryptoContextDCRTPoly>();
 }

+ 2 - 2
src/CryptoContext.h

@@ -67,7 +67,7 @@ public:
     friend bool SerializeEvalAutomorphismKeyToFile(const std::string& automorphismKeyLocation,
         const CryptoContextDCRTPoly& cryptoContext, const SerialMode serialMode);
 
-    explicit CryptoContextDCRTPoly() = default;
+    CryptoContextDCRTPoly() = default;
     explicit CryptoContextDCRTPoly(const ParamsBFVRNS& params);
     explicit CryptoContextDCRTPoly(const ParamsBGVRNS& params);
     explicit CryptoContextDCRTPoly(const ParamsCKKSRNS& params);
@@ -387,7 +387,7 @@ void ClearEvalAutomorphismKeysByCryptoContext(const CryptoContextDCRTPoly& crypt
 [[nodiscard]] std::unique_ptr<std::vector<uint32_t>> GetUniqueValues(
     const std::vector<uint32_t>& oldValues, const std::vector<uint32_t>& newValues);
 
-[[nodiscard]] std::unique_ptr<CryptoContextDCRTPoly> GenEmptyCryptoContext();
+[[nodiscard]] std::unique_ptr<CryptoContextDCRTPoly> GenNullCryptoContext();
 [[nodiscard]] std::unique_ptr<CryptoContextDCRTPoly> GenCryptoContextByParamsBFVRNS(
     const ParamsBFVRNS& params);
 [[nodiscard]] std::unique_ptr<CryptoContextDCRTPoly> GenCryptoContextByParamsBGVRNS(

+ 0 - 3
src/EvalKey.cc

@@ -5,9 +5,6 @@
 namespace openfhe
 {
 
-EvalKeyDCRTPoly::EvalKeyDCRTPoly()
-    : m_evalKey(std::make_shared<EvalKeyImpl>())
-{ }
 EvalKeyDCRTPoly::EvalKeyDCRTPoly(const std::shared_ptr<EvalKeyImpl>& evalKey)
     : m_evalKey(evalKey)
 { }

+ 0 - 1
src/EvalKey.h

@@ -12,7 +12,6 @@ class EvalKeyDCRTPoly final
 {
     std::shared_ptr<EvalKeyImpl> m_evalKey;
 public:
-    explicit EvalKeyDCRTPoly();
     explicit EvalKeyDCRTPoly(const std::shared_ptr<EvalKeyImpl>& evalKey);
     EvalKeyDCRTPoly(const EvalKeyDCRTPoly&) = delete;
     EvalKeyDCRTPoly(EvalKeyDCRTPoly&&) = delete;

+ 0 - 3
src/LWEPrivateKey.cc

@@ -5,9 +5,6 @@
 namespace openfhe
 {
 
-LWEPrivateKey::LWEPrivateKey()
-    : m_lwePrivateKey(std::make_shared<LWEPrivateKeyImpl>())
-{ }
 LWEPrivateKey::LWEPrivateKey(const std::shared_ptr<LWEPrivateKeyImpl>& lwePrivateKey)
     : m_lwePrivateKey(lwePrivateKey)
 { }

+ 0 - 1
src/LWEPrivateKey.h

@@ -11,7 +11,6 @@ class LWEPrivateKey final
 {
     std::shared_ptr<LWEPrivateKeyImpl> m_lwePrivateKey;
 public:
-    explicit LWEPrivateKey();
     explicit LWEPrivateKey(const std::shared_ptr<LWEPrivateKeyImpl>& lwePrivateKey);
     LWEPrivateKey(const LWEPrivateKey&) = delete;
     LWEPrivateKey(LWEPrivateKey&&) = delete;

+ 8 - 8
src/Params.cc

@@ -3,35 +3,35 @@
 namespace openfhe
 {
 
-std::unique_ptr<Params> GetParamsByScheme(const SCHEME scheme)
+std::unique_ptr<Params> GenParamsByScheme(const SCHEME scheme)
 {
     return std::make_unique<Params>(scheme);
 }
-std::unique_ptr<Params> GetParamsByVectorOfString(const std::vector<std::string>& vals)
+std::unique_ptr<Params> GenParamsByVectorOfString(const std::vector<std::string>& vals)
 {
     return std::make_unique<Params>(vals);
 }
-std::unique_ptr<ParamsBFVRNS> GetParamsBFVRNS()
+std::unique_ptr<ParamsBFVRNS> GenParamsBFVRNS()
 {
     return std::make_unique<ParamsBFVRNS>();
 }
-std::unique_ptr<ParamsBFVRNS> GetParamsBFVRNSbyVectorOfString(const std::vector<std::string>& vals)
+std::unique_ptr<ParamsBFVRNS> GenParamsBFVRNSbyVectorOfString(const std::vector<std::string>& vals)
 {
     return std::make_unique<ParamsBFVRNS>(vals);
 }
-std::unique_ptr<ParamsBGVRNS> GetParamsBGVRNS()
+std::unique_ptr<ParamsBGVRNS> GenParamsBGVRNS()
 {
     return std::make_unique<ParamsBGVRNS>();
 }
-std::unique_ptr<ParamsBGVRNS> GetParamsBGVRNSbyVectorOfString(const std::vector<std::string>& vals)
+std::unique_ptr<ParamsBGVRNS> GenParamsBGVRNSbyVectorOfString(const std::vector<std::string>& vals)
 {
     return std::make_unique<ParamsBGVRNS>(vals);
 }
-std::unique_ptr<ParamsCKKSRNS> GetParamsCKKSRNS()
+std::unique_ptr<ParamsCKKSRNS> GenParamsCKKSRNS()
 {
     return std::make_unique<ParamsCKKSRNS>();
 }
-std::unique_ptr<ParamsCKKSRNS> GetParamsCKKSRNSbyVectorOfString(
+std::unique_ptr<ParamsCKKSRNS> GenParamsCKKSRNSbyVectorOfString(
     const std::vector<std::string>& vals)
 {
     return std::make_unique<ParamsCKKSRNS>(vals);

+ 8 - 8
src/Params.h

@@ -26,17 +26,17 @@ using ParamsBFVRNS = lbcrypto::CCParams<lbcrypto::CryptoContextBFVRNS>;
 using ParamsBGVRNS = lbcrypto::CCParams<lbcrypto::CryptoContextBGVRNS>;
 using ParamsCKKSRNS = lbcrypto::CCParams<lbcrypto::CryptoContextCKKSRNS>;
 
-[[nodiscard]] std::unique_ptr<Params> GetParamsByScheme(const SCHEME scheme);
-[[nodiscard]] std::unique_ptr<Params> GetParamsByVectorOfString(
+[[nodiscard]] std::unique_ptr<Params> GenParamsByScheme(const SCHEME scheme);
+[[nodiscard]] std::unique_ptr<Params> GenParamsByVectorOfString(
     const std::vector<std::string>& vals);
-[[nodiscard]] std::unique_ptr<ParamsBFVRNS> GetParamsBFVRNS();
-[[nodiscard]] std::unique_ptr<ParamsBFVRNS> GetParamsBFVRNSbyVectorOfString(
+[[nodiscard]] std::unique_ptr<ParamsBFVRNS> GenParamsBFVRNS();
+[[nodiscard]] std::unique_ptr<ParamsBFVRNS> GenParamsBFVRNSbyVectorOfString(
     const std::vector<std::string>& vals);
-[[nodiscard]] std::unique_ptr<ParamsBGVRNS> GetParamsBGVRNS();
-[[nodiscard]] std::unique_ptr<ParamsBGVRNS> GetParamsBGVRNSbyVectorOfString(
+[[nodiscard]] std::unique_ptr<ParamsBGVRNS> GenParamsBGVRNS();
+[[nodiscard]] std::unique_ptr<ParamsBGVRNS> GenParamsBGVRNSbyVectorOfString(
     const std::vector<std::string>& vals);
-[[nodiscard]] std::unique_ptr<ParamsCKKSRNS> GetParamsCKKSRNS();
-[[nodiscard]] std::unique_ptr<ParamsCKKSRNS> GetParamsCKKSRNSbyVectorOfString(
+[[nodiscard]] std::unique_ptr<ParamsCKKSRNS> GenParamsCKKSRNS();
+[[nodiscard]] std::unique_ptr<ParamsCKKSRNS> GenParamsCKKSRNSbyVectorOfString(
     const std::vector<std::string>& vals);
 
 } // openfhe

+ 1 - 1
src/Plaintext.cc

@@ -136,7 +136,7 @@ const std::string& Plaintext::GetStringValue() const
 {
     return m_plaintext->GetStringValue();
 }
-std::unique_ptr<Plaintext> GenEmptyPlainText()
+std::unique_ptr<Plaintext> GenNullPlainText()
 {
     return std::make_unique<Plaintext>();
 }

+ 2 - 2
src/Plaintext.h

@@ -18,7 +18,7 @@ class Plaintext final
 {
     std::shared_ptr<PlaintextImpl> m_plaintext;
 public:
-    explicit Plaintext() = default;
+    Plaintext() = default;
     explicit Plaintext(const std::shared_ptr<PlaintextImpl>& plaintext);
     Plaintext(const Plaintext&) = delete;
     Plaintext(Plaintext&&) = delete;
@@ -56,6 +56,6 @@ public:
     [[nodiscard]] const std::vector<int64_t>& GetCoefPackedValue() const;
     [[nodiscard]] const std::string& GetStringValue() const;
 };
-[[nodiscard]] std::unique_ptr<Plaintext> GenEmptyPlainText();
+[[nodiscard]] std::unique_ptr<Plaintext> GenNullPlainText();
 
 } // openfhe

+ 0 - 3
src/PrivateKey.cc

@@ -5,9 +5,6 @@
 namespace openfhe
 {
 
-PrivateKeyDCRTPoly::PrivateKeyDCRTPoly()
-    : m_privateKey(std::make_shared<PrivateKeyImpl>())
-{ }
 PrivateKeyDCRTPoly::PrivateKeyDCRTPoly(const std::shared_ptr<PrivateKeyImpl>& privateKey)
     : m_privateKey(privateKey)
 { }

+ 0 - 1
src/PrivateKey.h

@@ -12,7 +12,6 @@ class PrivateKeyDCRTPoly final
 {
     std::shared_ptr<PrivateKeyImpl> m_privateKey;
 public:
-    explicit PrivateKeyDCRTPoly();
     explicit PrivateKeyDCRTPoly(const std::shared_ptr<PrivateKeyImpl>& privateKey);
     PrivateKeyDCRTPoly(const PrivateKeyDCRTPoly&) = delete;
     PrivateKeyDCRTPoly(PrivateKeyDCRTPoly&&) = delete;

+ 1 - 11
src/PublicKey.cc

@@ -5,12 +5,6 @@
 namespace openfhe
 {
 
-PublicKeyDCRTPoly::PublicKeyDCRTPoly()
-    : m_publicKey(std::make_shared<PublicKeyImpl>())
-{ }
-PublicKeyDCRTPoly::PublicKeyDCRTPoly(const std::nullptr_t)
-    : m_publicKey(nullptr)
-{ }
 PublicKeyDCRTPoly::PublicKeyDCRTPoly(const std::shared_ptr<PublicKeyImpl>& publicKey)
     : m_publicKey(publicKey)
 { }
@@ -18,13 +12,9 @@ std::shared_ptr<PublicKeyImpl> PublicKeyDCRTPoly::GetInternal() const
 {
     return m_publicKey;
 }
-std::unique_ptr<PublicKeyDCRTPoly> GenDefaultConstructedPublicKey()
-{
-    return std::make_unique<PublicKeyDCRTPoly>();
-}
 std::unique_ptr<PublicKeyDCRTPoly> GenNullPublicKey()
 {
-    return std::make_unique<PublicKeyDCRTPoly>(nullptr);
+    return std::make_unique<PublicKeyDCRTPoly>();
 }
 
 } // openfhe

+ 1 - 3
src/PublicKey.h

@@ -19,8 +19,7 @@ public:
     friend bool DeserializePublicKeyFromFile(const std::string& publicKeyLocation,
         PublicKeyDCRTPoly& publicKey, const SerialMode serialMode);
 
-    explicit PublicKeyDCRTPoly();
-    explicit PublicKeyDCRTPoly(const std::nullptr_t);
+    PublicKeyDCRTPoly() = default;
     explicit PublicKeyDCRTPoly(const std::shared_ptr<PublicKeyImpl>& publicKey);
 
     PublicKeyDCRTPoly(const PublicKeyDCRTPoly&) = delete;
@@ -30,7 +29,6 @@ public:
 
     [[nodiscard]] std::shared_ptr<PublicKeyImpl> GetInternal() const;
 };
-[[nodiscard]] std::unique_ptr<PublicKeyDCRTPoly> GenDefaultConstructedPublicKey();
 [[nodiscard]] std::unique_ptr<PublicKeyDCRTPoly> GenNullPublicKey();
 
 } // openfhe

+ 23 - 24
src/lib.rs

@@ -196,8 +196,8 @@ pub mod ffi
     // Params
     unsafe extern "C++"
     {
-        fn GetParamsByScheme(scheme: SCHEME) -> UniquePtr<Params>;
-        fn GetParamsByVectorOfString(vals: &CxxVector<CxxString>) -> UniquePtr<Params>;
+        fn GenParamsByScheme(scheme: SCHEME) -> UniquePtr<Params>;
+        fn GenParamsByVectorOfString(vals: &CxxVector<CxxString>) -> UniquePtr<Params>;
 
         // getters
         fn GetScheme(self: &Params) -> SCHEME;
@@ -269,8 +269,8 @@ pub mod ffi
     // ParamsBFVRNS
     unsafe extern "C++"
     {
-        fn GetParamsBFVRNS() -> UniquePtr<ParamsBFVRNS>;
-        fn GetParamsBFVRNSbyVectorOfString(vals: &CxxVector<CxxString>) -> UniquePtr<ParamsBFVRNS>;
+        fn GenParamsBFVRNS() -> UniquePtr<ParamsBFVRNS>;
+        fn GenParamsBFVRNSbyVectorOfString(vals: &CxxVector<CxxString>) -> UniquePtr<ParamsBFVRNS>;
         // getters
         fn GetScheme(self: &ParamsBFVRNS) -> SCHEME;
         fn GetPlaintextModulus(self: &ParamsBFVRNS) -> u64;
@@ -341,8 +341,8 @@ pub mod ffi
     // ParamsBGVRNS
     unsafe extern "C++"
     {
-        fn GetParamsBGVRNS() -> UniquePtr<ParamsBGVRNS>;
-        fn GetParamsBGVRNSbyVectorOfString(vals: &CxxVector<CxxString>) -> UniquePtr<ParamsBGVRNS>;
+        fn GenParamsBGVRNS() -> UniquePtr<ParamsBGVRNS>;
+        fn GenParamsBGVRNSbyVectorOfString(vals: &CxxVector<CxxString>) -> UniquePtr<ParamsBGVRNS>;
         // getters
         fn GetScheme(self: &ParamsBGVRNS) -> SCHEME;
         fn GetPlaintextModulus(self: &ParamsBGVRNS) -> u64;
@@ -413,8 +413,8 @@ pub mod ffi
     // ParamsCKKSRNS
     unsafe extern "C++"
     {
-        fn GetParamsCKKSRNS() -> UniquePtr<ParamsCKKSRNS>;
-        fn GetParamsCKKSRNSbyVectorOfString(vals: &CxxVector<CxxString>)
+        fn GenParamsCKKSRNS() -> UniquePtr<ParamsCKKSRNS>;
+        fn GenParamsCKKSRNSbyVectorOfString(vals: &CxxVector<CxxString>)
                                             -> UniquePtr<ParamsCKKSRNS>;
         // getters
         fn GetScheme(self: &ParamsCKKSRNS) -> SCHEME;
@@ -486,7 +486,6 @@ pub mod ffi
     // PublicKeyDCRTPoly
     unsafe extern "C++"
     {
-        fn GenDefaultConstructedPublicKey() -> UniquePtr<PublicKeyDCRTPoly>;
         fn GenNullPublicKey() -> UniquePtr<PublicKeyDCRTPoly>;
     }
 
@@ -500,7 +499,7 @@ pub mod ffi
     // Plaintext
     unsafe extern "C++"
     {
-        fn GenEmptyPlainText() -> UniquePtr<Plaintext>;
+        fn GenNullPlainText() -> UniquePtr<Plaintext>;
         fn SetLength(self: &Plaintext, newSize: usize);
         fn GetString(self: &Plaintext) -> String;
         fn GetLogPrecision(self: &Plaintext) -> f64;
@@ -533,13 +532,13 @@ pub mod ffi
     // CiphertextDCRTPoly
     unsafe extern "C++"
     {
-        fn GenDefaultConstructedCiphertext() -> UniquePtr<CiphertextDCRTPoly>;
+        fn GenNullCiphertext() -> UniquePtr<CiphertextDCRTPoly>;
     }
 
     // CryptoContextDCRTPoly
     unsafe extern "C++"
     {
-        fn GenEmptyCryptoContext() -> UniquePtr<CryptoContextDCRTPoly>;
+        fn GenNullCryptoContext() -> UniquePtr<CryptoContextDCRTPoly>;
         fn GenCryptoContextByParamsBFVRNS(params: &ParamsBFVRNS)
                                           -> UniquePtr<CryptoContextDCRTPoly>;
         fn GenCryptoContextByParamsBGVRNS(params: &ParamsBGVRNS)
@@ -952,7 +951,7 @@ mod tests
     #[test]
     fn SimpleIntegersExample()
     {
-        let mut _cc_params_bfvrns = ffi::GetParamsBFVRNS();
+        let mut _cc_params_bfvrns = ffi::GenParamsBFVRNS();
         _cc_params_bfvrns.pin_mut().SetPlaintextModulus(65537);
         _cc_params_bfvrns.pin_mut().SetMultiplicativeDepth(2);
 
@@ -1031,17 +1030,17 @@ mod tests
         let _cipher_text_rot_3 = _cc.EvalRotate(&_cipher_text_1, -1);
         let _cipher_text_rot_4 = _cc.EvalRotate(&_cipher_text_1, -2);
 
-        let mut _plain_text_add_result = ffi::GenEmptyPlainText();
+        let mut _plain_text_add_result = ffi::GenNullPlainText();
         _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_cipher_text_add_result, _plain_text_add_result.pin_mut());
-        let mut _plain_text_mult_result = ffi::GenEmptyPlainText();
+        let mut _plain_text_mult_result = ffi::GenNullPlainText();
         _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_cipher_text_mult_result, _plain_text_mult_result.pin_mut());
-        let mut _plain_text_rot_1 = ffi::GenEmptyPlainText();
+        let mut _plain_text_rot_1 = ffi::GenNullPlainText();
         _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_cipher_text_rot_1, _plain_text_rot_1.pin_mut());
-        let mut _plain_text_rot_2 = ffi::GenEmptyPlainText();
+        let mut _plain_text_rot_2 = ffi::GenNullPlainText();
         _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_cipher_text_rot_2, _plain_text_rot_2.pin_mut());
-        let mut _plain_text_rot_3 = ffi::GenEmptyPlainText();
+        let mut _plain_text_rot_3 = ffi::GenNullPlainText();
         _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_cipher_text_rot_3, _plain_text_rot_3.pin_mut());
-        let mut _plain_text_rot_4 = ffi::GenEmptyPlainText();
+        let mut _plain_text_rot_4 = ffi::GenNullPlainText();
         _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_cipher_text_rot_4, _plain_text_rot_4.pin_mut());
 
         _plain_text_rot_1.SetLength(_vector_of_ints_1.len());
@@ -1069,7 +1068,7 @@ mod tests
         let _scale_mod_size: u32 = 50;
         let _batch_size: u32 = 8;
 
-        let mut _cc_params_ckksrns = ffi::GetParamsCKKSRNS();
+        let mut _cc_params_ckksrns = ffi::GenParamsCKKSRNS();
         _cc_params_ckksrns.pin_mut().SetMultiplicativeDepth(_mult_depth);
         _cc_params_ckksrns.pin_mut().SetScalingModSize(_scale_mod_size);
         _cc_params_ckksrns.pin_mut().SetBatchSize(_batch_size);
@@ -1124,7 +1123,7 @@ mod tests
         let _c_rot_1 = _cc.EvalRotate(&_c1, 1);
         let _c_rot_2 = _cc.EvalRotate(&_c1, -2);
 
-        let mut _result = ffi::GenEmptyPlainText();
+        let mut _result = ffi::GenNullPlainText();
         println!("\nResults of homomorphic computations:");
 
         _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_c1, _result.pin_mut());
@@ -1163,7 +1162,7 @@ mod tests
         use std::time::Instant;
         println!("\n======EXAMPLE FOR EVALPOLY========\n");
 
-        let mut _cc_params_ckksrns = ffi::GetParamsCKKSRNS();
+        let mut _cc_params_ckksrns = ffi::GenParamsCKKSRNS();
         _cc_params_ckksrns.pin_mut().SetMultiplicativeDepth(6);
         _cc_params_ckksrns.pin_mut().SetScalingModSize(50);
 
@@ -1247,10 +1246,10 @@ mod tests
         let _result_2 = _cc.EvalPoly(&_cipher_text_1, &_coefficients_2);
         let _time_eval_poly_2 = _start.elapsed();
 
-        let mut _plain_text_dec = ffi::GenEmptyPlainText();
+        let mut _plain_text_dec = ffi::GenNullPlainText();
         _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_result, _plain_text_dec.pin_mut());
         _plain_text_dec.SetLength(_encoded_length);
-        let mut _plain_text_dec_2 = ffi::GenEmptyPlainText();
+        let mut _plain_text_dec_2 = ffi::GenNullPlainText();
         _cc.DecryptByPrivateKeyAndCiphertext(&_key_pair.GetPrivateKey(), &_result_2, _plain_text_dec_2.pin_mut());
         _plain_text_dec_2.SetLength(_encoded_length);