Use openfhe python after tenseal library

Hi! I am new in cryptography. I used the library TenSeal to encrypt data for linear regression training and evaluating. I want to switch libraries, but i find it hard to see which functions are equivalent. Can someone help me, please?

Those are the functions used in TenSeal:

# parameters
poly_mod_degree = 4096
coeff_mod_bit_sizes = [40, 20, 40]
# create TenSEALContext
ctx_eval = ts.context(ts.SCHEME_TYPE.CKKS, poly_mod_degree, -1, coeff_mod_bit_sizes)
# scale of ciphertext to use
ctx_eval.global_scale = 2 ** 20
# this key is needed for doing dot-product operations
ctx_eval.generate_galois_keys()

 enc_x_test = [ts.ckks_vector(ctx_eval, x.tolist()) for x in x_test[:700]]

#prediction function for my model
def forward_on_encrypted_data(self,enc_x):
        enc_pred = enc_x.dot(self.lr.weight.data.tolist()[0])+self.lr.bias.data.tolist()
        return enc_pred

Thank you!
@ypolyakov
@andreea.alexandru

Please look at the examples provided here openfhe-development/src/pke/examples at main · openfheorg/openfhe-development · GitHub, they are designed to provide a starting point for users of the library. Each of them shows how to generate the criptocontext, set the ring dimension (poly_mod_degree), generate the rotation keys for the inner product (generate_galois_keys), etc. For your application, take a look specifically at openfhe-development/src/pke/examples/inner-product.cpp at main · openfheorg/openfhe-development · GitHub.

Thank you for your suggestions! I will take a look and get back to you if i have any more questions.
Thanks for replaying!