Skip to content
This repository was archived by the owner on Nov 21, 2023. It is now read-only.
This repository was archived by the owner on Nov 21, 2023. It is now read-only.

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

@samartfang

Description

@samartfang

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)
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions