Skip to content

Can't easily use FheBool while writing programs #4

@RiverRuby

Description

@RiverRuby

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions