Template Class HELogicOperator< Scheme::BFV >

Inheritance Relationships

Base Type

Class Documentation

template<>
class HELogicOperator<Scheme::BFV> : private heongpu::HEOperator<Scheme::BFV>

HELogicOperator performs homomorphic logical operations on ciphertexts.

Public Functions

HELogicOperator(HEContext<Scheme::BFV> context, HEEncoder<Scheme::BFV> &encoder)

Constructs a new HELogicOperator object.

Parameters:
  • context – Encryption parameters.

  • encoder – Encoder for homomorphic operations.

inline void NOT(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &output, const ExecutionOptions &options = ExecutionOptions())

Performs logical NOT on ciphertext.

Parameters:
  • input1 – First input ciphertext.

  • output – Output ciphertext.

  • options – Execution options.

inline void NOT_inplace(Ciphertext<Scheme::BFV> &input1, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical NOT on ciphertext.

Parameters:
  • input1Ciphertext updated with result.

  • options – Execution options.

inline void AND(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &input2, Ciphertext<Scheme::BFV> &output, Relinkey<Scheme::BFV> &relin_key, const ExecutionOptions &options = ExecutionOptions())

Performs logical AND on two ciphertexts.

Parameters:
  • input1 – First input ciphertext.

  • input2 – Second input ciphertext.

  • output – Output ciphertext.

  • relin_key – Relinearization key.

  • options – Execution options.

inline void AND_inplace(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &input2, Relinkey<Scheme::BFV> &relin_key, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical AND on two ciphertexts.

Parameters:
  • input1Ciphertext updated with result.

  • input2 – Second input ciphertext.

  • relin_key – Relinearization key.

  • options – Execution options.

inline void AND(Ciphertext<Scheme::BFV> &input1, Plaintext<Scheme::BFV> &input2, Ciphertext<Scheme::BFV> &output, const ExecutionOptions &options = ExecutionOptions())

Performs logical AND on a ciphertext and a plaintext.

Parameters:
  • input1 – Input ciphertext.

  • input2 – Input plaintext.

  • output – Output ciphertext.

  • options – Execution options.

inline void AND_inplace(Ciphertext<Scheme::BFV> &input1, Plaintext<Scheme::BFV> &input2, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical AND on a ciphertext and a plaintext.

Parameters:
  • input1Ciphertext updated with result.

  • input2 – Input plaintext.

  • options – Execution options.

inline void OR(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &input2, Ciphertext<Scheme::BFV> &output, Relinkey<Scheme::BFV> &relin_key, const ExecutionOptions &options = ExecutionOptions())

Performs logical OR on two ciphertexts.

Parameters:
  • input1 – First input ciphertext.

  • input2 – Second input ciphertext.

  • output – Output ciphertext.

  • relin_key – Relinearization key.

  • options – Execution options.

inline void OR_inplace(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &input2, Relinkey<Scheme::BFV> &relin_key, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical OR on two ciphertexts.

Parameters:
  • input1Ciphertext updated with result.

  • input2 – Second input ciphertext.

  • relin_key – Relinearization key.

  • options – Execution options.

inline void OR(Ciphertext<Scheme::BFV> &input1, Plaintext<Scheme::BFV> &input2, Ciphertext<Scheme::BFV> &output, const ExecutionOptions &options = ExecutionOptions())

Performs logical OR on a ciphertext and a plaintext.

Parameters:
  • input1 – Input ciphertext.

  • input2 – Input plaintext.

  • output – Output ciphertext.

  • options – Execution options.

inline void OR_inplace(Ciphertext<Scheme::BFV> &input1, Plaintext<Scheme::BFV> &input2, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical OR on a ciphertext and a plaintext.

Parameters:
  • input1Ciphertext updated with result.

  • input2 – Input plaintext.

  • options – Execution options.

inline void XOR(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &input2, Ciphertext<Scheme::BFV> &output, Relinkey<Scheme::BFV> &relin_key, const ExecutionOptions &options = ExecutionOptions())

Performs logical XOR on two ciphertexts.

Parameters:
  • input1 – First input ciphertext.

  • input2 – Second input ciphertext.

  • output – Output ciphertext.

  • relin_key – Relinearization key.

  • options – Execution options.

inline void XOR_inplace(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &input2, Relinkey<Scheme::BFV> &relin_key, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical XOR on two ciphertexts.

Parameters:
  • input1Ciphertext updated with result.

  • input2 – Second input ciphertext.

  • relin_key – Relinearization key.

  • options – Execution options.

inline void XOR(Ciphertext<Scheme::BFV> &input1, Plaintext<Scheme::BFV> &input2, Ciphertext<Scheme::BFV> &output, const ExecutionOptions &options = ExecutionOptions())

Performs logical XOR on a ciphertext and a plaintext.

Parameters:
  • input1 – Input ciphertext.

  • input2 – Input plaintext.

  • output – Output ciphertext.

  • options – Execution options.

inline void XOR_inplace(Ciphertext<Scheme::BFV> &input1, Plaintext<Scheme::BFV> &input2, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical XOR on a ciphertext and a plaintext.

Parameters:
  • input1Ciphertext updated with result.

  • input2 – Input plaintext.

  • options – Execution options.

inline void NAND(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &input2, Ciphertext<Scheme::BFV> &output, Relinkey<Scheme::BFV> &relin_key, const ExecutionOptions &options = ExecutionOptions())

Performs logical NAND on two ciphertexts.

Parameters:
  • input1 – First input ciphertext.

  • input2 – Second input ciphertext.

  • output – Output ciphertext.

  • relin_key – Relinearization key.

  • options – Execution options.

inline void NAND_inplace(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &input2, Relinkey<Scheme::BFV> &relin_key, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical NAND on two ciphertexts.

Parameters:
  • input1Ciphertext updated with result.

  • input2 – Second input ciphertext.

  • relin_key – Relinearization key.

  • options – Execution options.

inline void NAND(Ciphertext<Scheme::BFV> &input1, Plaintext<Scheme::BFV> &input2, Ciphertext<Scheme::BFV> &output, const ExecutionOptions &options = ExecutionOptions())

Performs logical NAND on a ciphertext and a plaintext.

Parameters:
  • input1 – Input ciphertext.

  • input2 – Input plaintext.

  • output – Output ciphertext.

  • options – Execution options.

inline void NAND_inplace(Ciphertext<Scheme::BFV> &input1, Plaintext<Scheme::BFV> &input2, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical NAND on a ciphertext and a plaintext.

Parameters:
  • input1Ciphertext updated with result.

  • input2 – Input plaintext.

  • options – Execution options.

inline void NOR(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &input2, Ciphertext<Scheme::BFV> &output, Relinkey<Scheme::BFV> &relin_key, const ExecutionOptions &options = ExecutionOptions())

Performs logical NOR on two ciphertexts.

Parameters:
  • input1 – First input ciphertext.

  • input2 – Second input ciphertext.

  • output – Output ciphertext.

  • relin_key – Relinearization key.

  • options – Execution options.

inline void NOR_inplace(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &input2, Relinkey<Scheme::BFV> &relin_key, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical NOR on two ciphertexts.

Parameters:
  • input1Ciphertext updated with result.

  • input2 – Second input ciphertext.

  • relin_key – Relinearization key.

  • options – Execution options.

inline void NOR(Ciphertext<Scheme::BFV> &input1, Plaintext<Scheme::BFV> &input2, Ciphertext<Scheme::BFV> &output, const ExecutionOptions &options = ExecutionOptions())

Performs logical NOR on a ciphertext and a plaintext.

Parameters:
  • input1 – Input ciphertext.

  • input2 – Input plaintext.

  • output – Output ciphertext.

  • options – Execution options.

inline void NOR_inplace(Ciphertext<Scheme::BFV> &input1, Plaintext<Scheme::BFV> &input2, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical NOR on a ciphertext and a plaintext.

Parameters:
  • input1Ciphertext updated with result.

  • input2 – Input plaintext.

  • options – Execution options.

inline void XNOR(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &input2, Ciphertext<Scheme::BFV> &output, Relinkey<Scheme::BFV> &relin_key, const ExecutionOptions &options = ExecutionOptions())

Performs logical XNOR on two ciphertexts.

Parameters:
  • input1 – First input ciphertext.

  • input2 – Second input ciphertext.

  • output – Output ciphertext.

  • relin_key – Relinearization key.

  • options – Execution options.

inline void XNOR_inplace(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &input2, Relinkey<Scheme::BFV> &relin_key, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical XNOR on two ciphertexts.

Parameters:
  • input1Ciphertext updated with result.

  • input2 – Second input ciphertext.

  • relin_key – Relinearization key.

  • options – Execution options.

inline void XNOR(Ciphertext<Scheme::BFV> &input1, Plaintext<Scheme::BFV> &input2, Ciphertext<Scheme::BFV> &output, const ExecutionOptions &options = ExecutionOptions())

Performs logical XNOR on a ciphertext and a plaintext.

Parameters:
  • input1 – Input ciphertext.

  • input2 – Input plaintext.

  • output – Output ciphertext.

  • options – Execution options.

inline void XNOR_inplace(Ciphertext<Scheme::BFV> &input1, Plaintext<Scheme::BFV> &input2, const ExecutionOptions &options = ExecutionOptions())

Performs in-place logical XNOR on a ciphertext and a plaintext.

Parameters:
  • input1Ciphertext updated with result.

  • input2 – Input plaintext.

  • options – Execution options.

void one_minus_cipher(Ciphertext<Scheme::BFV> &input1, Ciphertext<Scheme::BFV> &output, const ExecutionOptions &options = ExecutionOptions())
void one_minus_cipher_inplace(Ciphertext<Scheme::BFV> &input1, const ExecutionOptions &options = ExecutionOptions())

Public Members

DeviceVector<Data64> encoded_constant_one_