Skip to content

Commit

Permalink
fix(frontend-python): Fixing default circuit name in tfhe-rs bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
BourgerieQuentin committed Sep 26, 2024
1 parent 855e627 commit 11bf8d9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def lwe_secret_key_param(self, key_id: int) -> LweSecretKeyParam:
raise TypeError(f"key_id must be of type int, not {type(key_id)}")
return LweSecretKeyParam.wrap(self.cpp().lwe_secret_key_param(key_id))

def input_keyid_at(self, input_idx: int, circuit_name: str = "main") -> int:
def input_keyid_at(self, input_idx: int, circuit_name: str = "<lambda>") -> int:
"""Get the keyid of a selected encrypted input in a given circuit.
Args:
Expand Down
2 changes: 1 addition & 1 deletion frontends/concrete-python/concrete/fhe/tfhers/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def keygen_with_initial_keys(

def new_bridge(
circuit: "fhe.Circuit",
func_name: str = "main",
func_name: str = "<lambda>",
) -> Bridge:
"""Create a TFHErs bridge from a circuit.
Expand Down
2 changes: 1 addition & 1 deletion frontends/concrete-python/examples/tfhers/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def ccompilee():
inputset = [(tfhers_int(120), tfhers_int(120))]
circuit = compiler.compile(inputset)

tfhers_bridge = tfhers.new_bridge(circuit=circuit, func_name="main")
tfhers_bridge = tfhers.new_bridge(circuit=circuit)
return circuit, tfhers_bridge


Expand Down
8 changes: 4 additions & 4 deletions frontends/concrete-python/tests/execution/test_tfhers.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def test_tfhers_binary_encrypted_complete_circuit_concrete_keygen(
assert (dtype.decode(concrete_encoded_result) == function(*sample)).all()

###### TFHErs Encryption & Computation ########################################
tfhers_bridge = tfhers.new_bridge(circuit, func_name="main")
tfhers_bridge = tfhers.new_bridge(circuit)

# serialize key
_, key_path = tempfile.mkstemp()
Expand Down Expand Up @@ -617,7 +617,7 @@ def test_tfhers_one_tfhers_one_native_complete_circuit_concrete_keygen(
assert (dtype.decode(concrete_encoded_result) == function(*sample)).all()

###### TFHErs Encryption ######################################################
tfhers_bridge = tfhers.new_bridge(circuit, func_name="main")
tfhers_bridge = tfhers.new_bridge(circuit)

# serialize key
_, key_path = tempfile.mkstemp()
Expand Down Expand Up @@ -780,7 +780,7 @@ def test_tfhers_binary_encrypted_complete_circuit_tfhers_keygen(
)

###### Concrete Keygen ########################################################
tfhers_bridge = tfhers.new_bridge(circuit, func_name="main")
tfhers_bridge = tfhers.new_bridge(circuit)

with open(sk_path, "rb") as f:
sk_buff = f.read()
Expand Down Expand Up @@ -1044,7 +1044,7 @@ def test_tfhers_one_tfhers_one_native_complete_circuit_tfhers_keygen(
)

###### Concrete Keygen ########################################################
tfhers_bridge = tfhers.new_bridge(circuit, func_name="main")
tfhers_bridge = tfhers.new_bridge(circuit)

with open(sk_path, "rb") as f:
sk_buff = f.read()
Expand Down

0 comments on commit 11bf8d9

Please sign in to comment.