Browse Source

Fixing cxx export issue

Hovsep Papoyan 1 year ago
parent
commit
aeedaafea9
3 changed files with 5 additions and 6 deletions
  1. 2 3
      examples/polynomial_evaluation.rs
  2. 2 3
      examples/simple_real_numbers.rs
  3. 1 0
      src/lib.rs

+ 2 - 3
examples/polynomial_evaluation.rs

@@ -1,5 +1,4 @@
-extern crate openfhe;
-use cxx::{CxxVector, SharedPtr};
+use openfhe::cxx::{CxxVector, SharedPtr};
 use openfhe::ffi as ffi;
 
 fn main()
@@ -109,4 +108,4 @@ fn main()
     println!("{}\n", _plain_text_dec_2.GetString());
     println!(" Expected result: (3.4515092326, 5.3752765397, 4.8993108833, 3.2495023573, 4.0485229982)");
     print!("\n Evaluation time: {:.0?}\n", _time_eval_poly_2);
-}
+}

+ 2 - 3
examples/simple_real_numbers.rs

@@ -1,5 +1,4 @@
-extern crate openfhe;
-use cxx::{CxxVector, SharedPtr};
+use openfhe::cxx::{CxxVector, SharedPtr};
 use openfhe::ffi as ffi;
 
 fn main()
@@ -94,4 +93,4 @@ fn main()
     _cc.Decrypt(_key_pair.GetPrivateKey(), _c_rot_2.GetCipherText(), _result.pin_mut());
     _result.SetLength(_batch_size.try_into().unwrap());
     println!("x1 rotate by -2 = {}", _result.GetString());
-}
+}

+ 1 - 0
src/lib.rs

@@ -3,6 +3,7 @@
 #![allow(unused_imports)]
 
 use cxx::{CxxVector, SharedPtr, let_cxx_string};
+pub use cxx;
 
 #[cxx::bridge(namespace = "openfhe")]
 pub mod ffi