zama-ai/concrete

if_then_else support clear values for branch result

rudy-6-4 opened this issue · 1 comments

Summary

Support for:

1

if_then_else(encrypted_condition, 1,encrypted_b) 

can be rewrite to:

cond * (encrypted_b-1) + 1

so it could be faster than the full if_then_else

2

if_then_else(encrypted_condition, 1, 2)

The last case can appear in degenerate case (initial loop condition) or before when playing a code.
The last case can be optimize to one TLU call.