from openfhe import *
import pickle5 as pickle
Sample Program: Step 1: Set CryptoContext
cc = BinFHEContext()
file_name = ‘std1.pkl’
Writing the student object to a file using pickle
with open(file_name, ‘wb’) as file:
pickle.dump(cc, file,protocol=pickle.HIGHEST_PROTOCOL)
print(f’Object successfully saved to “{file_name}”')
Error is
TypeError Traceback (most recent call last)
Cell In[22], line 4
2 # Writing the student object to a file using pickle
3 with open(file_name, ‘wb’) as file:
----> 4 pickle.dump(cc, file,protocol=pickle.HIGHEST_PROTOCOL)
5 print(f’Object successfully saved to “{file_name}”')
TypeError: cannot pickle ‘openfhe.BinFHEContext’ object