pub type FheProgram = Context<Operation, SchemeType>;
Expand description

The intermediate representation for an FHE program used in the compiler back-end.

Aliased Type§

struct FheProgram {
    pub graph: CompilationResult<Operation>,
    pub data: SchemeType,
}

Fields§

§graph: CompilationResult<Operation>

The parse graph.

§data: SchemeType

Data given by the consumer.

Trait Implementations§

source§

impl FheProgramTrait for FheProgram

source§

fn add_negate(&mut self, x: NodeIndex) -> NodeIndex

Appends a negate operation that depends on operand x.
source§

fn add_multiply(&mut self, x: NodeIndex, y: NodeIndex) -> NodeIndex

Appends a multiply operation that depends on the operands x and y.
source§

fn add_multiply_plaintext(&mut self, x: NodeIndex, y: NodeIndex) -> NodeIndex

Appends a multiply operation that depends on the operands x and y.
source§

fn add_add(&mut self, x: NodeIndex, y: NodeIndex) -> NodeIndex

Appends an add operation that depends on the operands x and y.
source§

fn add_sub(&mut self, x: NodeIndex, y: NodeIndex) -> NodeIndex

Appends a subtract operation that depends on the operands x and y.
source§

fn add_input_ciphertext(&mut self, id: usize) -> NodeIndex

Appends an input ciphertext with the given name.
source§

fn add_input_plaintext(&mut self, id: usize) -> NodeIndex

Appends an input plaintext with the given name.
source§

fn add_input_literal(&mut self, value: Literal) -> NodeIndex

Appends a constant literal. Read more
source§

fn add_output_ciphertext(&mut self, x: NodeIndex) -> NodeIndex

Adds a node designating x as an output of the FHE program.
source§

fn add_relinearize(&mut self, x: NodeIndex) -> NodeIndex

Appends an operation that relinearizes x.
source§

fn add_rotate_left(&mut self, x: NodeIndex, y: NodeIndex) -> NodeIndex

Appends an operation that rotates ciphertext x left by the literal node at y places. Read more
source§

fn append_rotate_right(&mut self, x: NodeIndex, y: NodeIndex) -> NodeIndex

Appends an operation that rotates ciphertext x right by the literal node at y places. Read more
source§

fn get_outputs(&self) -> Box<dyn Iterator<Item = NodeIndex> + '_>

Returns the node indices of output ciphertexts
source§

fn num_inputs(&self) -> usize

Returns the number of inputs ciphertexts this FHE program takes.
source§

fn prune(&self, nodes: &[NodeIndex]) -> FheProgram

Runs tree shaking and returns a derived FheProgram with only dependencies required to run the requested nodes. Read more
source§

fn validate(&self) -> Result<()>

Validates this FheProgram for correctness.
source§

fn requires_relin_keys(&self) -> bool

Whether or not this FHE program needs relin keys to run. Needed for relinearization.
source§

fn requires_galois_keys(&self) -> bool

Whether or not this FHE program requires Galois keys to run. Needed for rotation and row swap operations.