pub trait FheProgramTrait {
Show 18 methods // Required methods fn add_negate(&mut self, x: NodeIndex) -> NodeIndex; fn add_multiply(&mut self, x: NodeIndex, y: NodeIndex) -> NodeIndex; fn add_multiply_plaintext( &mut self, x: NodeIndex, y: NodeIndex ) -> NodeIndex; fn add_add(&mut self, x: NodeIndex, y: NodeIndex) -> NodeIndex; fn add_sub(&mut self, x: NodeIndex, y: NodeIndex) -> NodeIndex; fn add_input_ciphertext(&mut self, id: usize) -> NodeIndex; fn add_input_plaintext(&mut self, id: usize) -> NodeIndex; fn add_input_literal(&mut self, value: Literal) -> NodeIndex; fn add_output_ciphertext(&mut self, x: NodeIndex) -> NodeIndex; fn add_relinearize(&mut self, x: NodeIndex) -> NodeIndex; fn add_rotate_left(&mut self, x: NodeIndex, y: NodeIndex) -> NodeIndex; fn append_rotate_right(&mut self, x: NodeIndex, y: NodeIndex) -> NodeIndex; fn get_outputs(&self) -> Box<dyn Iterator<Item = NodeIndex> + '_>; fn num_inputs(&self) -> usize; fn prune(&self, nodes: &[NodeIndex]) -> Self; fn validate(&self) -> Result<()>; fn requires_relin_keys(&self) -> bool; fn requires_galois_keys(&self) -> bool;
}
Expand description

Extension methods for FheProgram.

Required Methods§

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.

  • value: The integer or floating-point value in the literal.
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.

Remarks

Recall that BFV has 2 rows in a Batched vector. This rotates each row. CKKS has one large vector.

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.

Remarks

Recall that BFV has 2 rows in a Batched vector. This rotates each row. CKKS has one large vector.

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]) -> Self

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

  • nodes: indices specifying a set of nodes in the graph. Prune return a new FheProgram containing nodes in the transitive closure of this set.
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.

Implementors§