Direct Circuits
from concrete import fhe
@fhe.circuit({"x": "encrypted"})
def circuit(x: fhe.uint8):
return x + 42
assert circuit.encrypt_run_decrypt(10) == 52from concrete import fhe
import numpy as np
def square(value):
return value ** 2
@fhe.circuit({"x": "encrypted", "y": "encrypted"})
def circuit(x: fhe.uint8, y: fhe.int2):
a = x + 10
b = y + 10
c = np.sqrt(a).round().astype(fhe.uint4)
d = fhe.univariate(square, outputs=fhe.uint8)(b)
return d - c
print(circuit)Last updated
Was this helpful?