heir
heir copied to clipboard
frontend: support "casting" between MLIR types
Tries to address the use case presented in #1789 though it does so not via type hints but via adding support for casts:
def sub_bytes(x: Secret[I8]):
x0 = I1((x >> 7) & 1)
x1 = I1((x >> 6) & 1)
x2 = I1((x >> 5) & 1)
x3 = I1((x >> 4) & 1)
...
Still WIP:
- There are some open questions around what the expected behavior should be for arithmetic FHE (see discussion in the issue)
- If we want to only support it for CGGI for now, this might depend on #1783 (not sure if that's 100% necessary, though)
- There should probably be some tests once we determined what exactly it should be doing/not doing in the C++ side of things.
- For practical reasons, this also depends on #1824 (which, in turn, is blocked by #1823)