heir icon indicating copy to clipboard operation
heir copied to clipboard

Add a mechanism to distinguish between trivial encryptions and nontrivial encryptions at the secret level

Open j2kun opened this issue 6 months ago • 4 comments

Maybe secret.conceal should have a trivial attribute that denotes this, otherwise server-side uses of secret.conceal on static plaintexts (say, for resolving type mismatches) would cause the noise analysis to think it's a fresh encryption rather than a zero-noise encryption.

j2kun avatar Jun 03 '25 21:06 j2kun

:+1:

Maybe we should also consider more fine-grained differentation for the noise of encryptions (e.g., public vs private key)? Btw, where do we currently use secret.conceal for trivial encryptions?

AlexanderViand avatar Jun 03 '25 21:06 AlexanderViand

Btw, where do we currently use secret.conceal for trivial encryptions?

This will only happen if there's some reason to reconcile types - rarely happens, but see https://github.com/google/heir/blob/da734afdeaf5e4a1e4f4fb594d0e036bec7ae260/lib/Dialect/Secret/Transforms/DistributeGeneric.cpp#L262 for the iter_args of a loop

asraa avatar Jun 03 '25 22:06 asraa

Yeah this is not relevant for most cases since most back ends have ct-pt ops that can be matched at secret-to-scheme, after which point the type system includes sk/pk differentiation as well.

j2kun avatar Jun 03 '25 23:06 j2kun

This issue has 3 outstanding TODOs:

This comment was autogenerated by todo-backlinks

github-actions[bot] avatar Jun 04 '25 17:06 github-actions[bot]