nufhe icon indicating copy to clipboard operation
nufhe copied to clipboard

gate_mux with the OverflowError :"Python int too large to convert to C long"

Open samartfang opened this issue 1 year ago • 0 comments

Hello, I want to use gate_mux, but I get an error "Python int too large to convert to C long" when compiling. Do you know what the reason is?

` import random import numpy import nufhe from reikna.cluda import any_api size = 32 bits1 = [random.choice([False, True]) for i in range(size)] bits2 = [random.choice([False, True]) for i in range(size)] bits3 = [random.choice([False, True]) for i in range(size)]

thr = any_api().Thread.create(interactive=True) rng = nufhe.DeterministicRNG() secret_key, cloud_key = nufhe.make_key_pair(thr, rng) ciphertext1 = nufhe.encrypt(thr, rng, secret_key, bits1) ciphertext2 = nufhe.encrypt(thr, rng, secret_key, bits2) ciphertext3 = nufhe.encrypt(thr, rng, secret_key, bits3) result = nufhe.empty_ciphertext(thr, cloud_key.params, ciphertext1.shape) nufhe.gate_mux(thr, cloud_key, result, ciphertext1, ciphertext2, ciphertext3)

result_bits = nufhe.decrypt(thr, secret_key, result) `

samartfang avatar Sep 08 '22 02:09 samartfang