cc <- fhe_context("CKKS", multiplicative_depth = 4L, scaling_mod_size = 50L,
batch_size = 8L, features = Feature$ADVANCEDSHE)
keys <- key_gen(cc, eval_mult = TRUE)
ct <- encrypt(keys@public, make_ckks_packed_plaintext(cc, c(0.5, 1, 2)), cc = cc)
p <- c(1, 0, 2, 0, 0, 1)
q <- c(0, 1, 0, 3, 0, -1)
powers <- eval_powers(ct, p)
ct_p <- eval_poly_with_precomp(powers, p)
ct_q <- eval_poly_with_precomp(powers, q)
Run the code above in your browser using DataLab