Browse Source

Merge branch 'Oliveira_phase2_cryptocontext' of github.com:openfheorg/openfhe-python into Oliveira_phase2_cryptocontext

Rener Oliveira (Ubuntu WSL) 1 year ago
parent
commit
1cc7246745
2 changed files with 7 additions and 7 deletions
  1. 1 1
      src/bindings.cpp
  2. 6 6
      src/pke/examples/simple-real-numbers.py

+ 1 - 1
src/bindings.cpp

@@ -451,7 +451,7 @@ void bind_enums_and_constants(py::module &m)
 
     //NATIVEINT function
     m.def("get_native_int", &get_native_int);
-
+  
     // EvalKeyMap
     py::bind_map<std::map<usint, EvalKey<DCRTPoly>>>(m, "EvalKeyMap");
 }

+ 6 - 6
src/pke/examples/simple-real-numbers.py

@@ -48,7 +48,7 @@ c_rot2 = cc.EvalRotate(c1, -2)
 
 # Step 5: Decryption and output
 # Decrypt the result of additions
-ptAdd = Decrypt(c_add,keys.secretKey)
+ptAdd = cc.Decrypt(c_add,keys.secretKey)
 
 # We set the precision to 8 decimal digits for a nicer output.
 # If you want to see the error/noise introduced by CKKS, bump it up
@@ -56,28 +56,28 @@ ptAdd = Decrypt(c_add,keys.secretKey)
 
 precision = 8
 print("Results of homomorphic computations:")
-result = Decrypt(c1, keys.secretKey)
+result = cc.Decrypt(c1, keys.secretKey)
 result.SetLength(batch_size)
 print("x1 = " + str(result))
 print("Estimated precision in bits: " + str(result.GetLogPrecision()))
 
 # Decrypt the result of scalar multiplication
-result = Decrypt(c_scalar,keys.secretKey)
+result = cc.Decrypt(c_scalar,keys.secretKey)
 result.SetLength(batch_size)
 print("4 * x1 = " + str(result))
 
 # Decrypt the result of multiplication
-result = Decrypt(c_mult,keys.secretKey)
+result = cc.Decrypt(c_mult,keys.secretKey)
 result.SetLength(batch_size)
 print("x1 * x2 = " + str(result))
 
 # Decrypt the result of rotations
-result = Decrypt(c_rot1,keys.secretKey)
+result = cc.Decrypt(c_rot1,keys.secretKey)
 result.SetLength(batch_size)
 print("In rotations, very small outputs (~10^-10 here) correspond to 0's:")
 print("x1 rotated by 1 = " + str(result))
 
-result = Decrypt(c_rot2,keys.secretKey)
+result = cc.Decrypt(c_rot2,keys.secretKey)
 result.SetLength(batch_size)
 print("x1 rotated by -2 = " + str(result))