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