Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't easily use FheBool while writing programs #4

Open
RiverRuby opened this issue Jul 18, 2024 · 0 comments
Open

Can't easily use FheBool while writing programs #4

RiverRuby opened this issue Jul 18, 2024 · 0 comments

Comments

@RiverRuby
Copy link
Collaborator

RiverRuby commented Jul 18, 2024

It'd be quite nice to have FheBool available in the VM to write circuits. As we're using FHEW, all binary operations are far faster than multiplies and there's a few queries I want to write that are mostly boolean operations. I was able to make it work by making certain functions public for a hiring query I've been working on: https://github.com/RiverRuby/phantom-zone/blob/e56ab8ad6b9f2a45d5cd645b2a50b41ba651bec9/examples/non_interactive_hiring.rs

I can make a PR with this fork once I clean up some code, but I'm not sure if I'm breaking other abstractions. There's also a few quirks that I'd like to bring up:

  • Need to specify the NonInteractiveBatchedFheBools<_> type for boolean encryptions, don't need to do this for u8 encryptions
  • Need to make a reference everytime you do an operation with FheBools, leading to kind of confusing code like &(&(&a.queryable & &b.queryable) & &(&a.position ^ &b.position)) & &((&a.salary.gt(&b.salary)) ^ &b.position)
  • Need to specify FheBool by putting Vec<u64> of encryption into data field which isn't necessary for FheUint8
  • FheBool has a extract function, whereas FheUint8 has extract_at, should likely be the same
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant