#include <PrivPointUtil.h>
|
std::vector< long > | encodePoint (int, int, int) |
|
helib::Ctxt | secureLT (Encryptor &, int, int, helib::Ctxt, helib::Ptxt< helib::BGV >) |
|
helib::Ctxt | secureGT (Encryptor &, int, int, helib::Ctxt, helib::Ptxt< helib::BGV >) |
|
helib::Ctxt | secureLT (Encryptor &, int, int, helib::Ctxt, helib::Ctxt) |
|
helib::Ctxt | secureGT (Encryptor &, int, int, helib::Ctxt, helib::Ctxt) |
|
helib::Ctxt | binaryAdd (Encryptor &, int, int, helib::Ctxt, helib::Ptxt< helib::BGV >) |
|
helib::Ctxt | binaryMult (Encryptor &, int, int, helib::Ctxt, helib::Ptxt< helib::BGV >, int) |
|
int | processResult (Encryptor &, helib::Ctxt, int, int) |
|
Authored by Adam Caulfield (ac7717). November 3 2021.
◆ binaryAdd()
helib::Ctxt PrivPointUtil::binaryAdd |
( |
Encryptor & |
encryptor, |
|
|
int |
maxBits, |
|
|
int |
nSlots, |
|
|
helib::Ctxt |
a, |
|
|
helib::Ptxt< helib::BGV > |
b |
|
) |
| |
Conducts binary addition (full adder) between binary integers in a ciphertext and plaintext
- Parameters
-
Encryptor | &encryptor - encryptor object |
int | maxBits - bit-length |
int | nSlots - ciphertext slots |
helib::Ctxt | - binary value A, encrypted as a ciphertext |
helib::Ctxt | - binary value B, encoded as a plaintext vector, specifying the BGV scheme |
- Returns
- helib::Ctxt - returns the binary value of A + B
◆ binaryMult()
helib::Ctxt PrivPointUtil::binaryMult |
( |
Encryptor & |
encryptor, |
|
|
int |
maxBits, |
|
|
int |
nSlots, |
|
|
helib::Ctxt |
a, |
|
|
helib::Ptxt< helib::BGV > |
b, |
|
|
int |
y |
|
) |
| |
Conducts binary multiplier between binary integers in a ciphertext and plaintext
- Parameters
-
Encryptor | &encryptor - encryptor object |
int | maxBits - bit-length |
int | nSlots - ciphertext slots |
helib::Ctxt | - binary value A, encrypted as a ciphertext |
helib::Ctxt | - binary value B, encoded as a plaintext vector, specifying the BGV scheme |
int | y - multiplying the y (1) or x (0) value of the point. |
- Returns
- helib::Ctxt - returns the binary value of A * B
◆ encodePoint()
std::vector< long > PrivPointUtil::encodePoint |
( |
int |
maxBits, |
|
|
int |
p, |
|
|
int |
nSlots |
|
) |
| |
Given the integer, the max number of bits, and the number of ciphertext slots, encodes the integer into a vector of binary. It is encoded such that the ith index has the ith bit.
- Parameters
-
int | value: the integer |
int | maxBits: bit-length |
int | nSlots: ciphertext slots |
- Returns
- std::vector<long>
◆ processResult()
int PrivPointUtil::processResult |
( |
Encryptor & |
encryptor, |
|
|
helib::Ctxt |
resultCtxt, |
|
|
int |
nSlots, |
|
|
int |
total |
|
) |
| |
Takes a ciphertext expected to contain the result. Decrypts it and converts the binary number into a decimal integer.
- Parameters
-
Encryptor | &encryptor - encryptor object |
helib::Ctxt | - result ciphertext |
int | nSlots - ciphertext slots |
int | total - total bits to print |
- Returns
- int - returns the decimal integer of the result
◆ secureGT() [1/2]
helib::Ctxt PrivPointUtil::secureGT |
( |
Encryptor & |
encryptor, |
|
|
int |
maxBits, |
|
|
int |
nSlots, |
|
|
helib::Ctxt |
a, |
|
|
helib::Ptxt< helib::BGV > |
b |
|
) |
| |
Conducts greater than operation between a ciphertext and a plaintext vector (for X-Node). Implements the secure comparison by Aloufi et. al.
- Parameters
-
Encryptor | &encryptor - encryptor object |
int | maxBits - bit-length |
int | nSlots - ciphertext slots |
helib::Ctxt | - binary value A, encrypted as a ciphertext |
helib::Ptxt<helib::BGV> | - binary value B, encoded as a plaintext vector, specifying the BGV scheme |
- Returns
- helib::Ctxt - ciphertext representing A > B
◆ secureGT() [2/2]
helib::Ctxt PrivPointUtil::secureGT |
( |
Encryptor & |
encryptor, |
|
|
int |
maxBits, |
|
|
int |
nSlots, |
|
|
helib::Ctxt |
a, |
|
|
helib::Ctxt |
b |
|
) |
| |
Conducts secure greater than operation between two ciphertexts (for Y-Node). Implements the secure comparison by Aloufi et. al.
- Parameters
-
Encryptor | &encryptor - encryptor object |
int | maxBits - bit-length |
int | nSlots - ciphertext slots |
helib::Ctxt | - binary value A, encrypted as a ciphertext |
helib::Ctxt | - binary value B, encrypted as a ciphertext |
- Returns
- helib::Ctxt - ciphertext representing A > B
◆ secureLT() [1/2]
helib::Ctxt PrivPointUtil::secureLT |
( |
Encryptor & |
encryptor, |
|
|
int |
maxBits, |
|
|
int |
nSlots, |
|
|
helib::Ctxt |
a, |
|
|
helib::Ptxt< helib::BGV > |
b |
|
) |
| |
Conducts secure less than or equal to operation between a ciphertext and a plaintext vector (for X-Node). Implements the secure comparison by Aloufi et. al.
- Parameters
-
Encryptor | &encryptor - encryptor object |
int | maxBits - bit-length |
int | nSlots - ciphertext slots |
helib::Ctxt | - binary value A, encrypted as a ciphertext |
helib::Ptxt<helib::BGV> | - binary value B, encoded as a plaintext vector, specifying the BGV scheme |
- Returns
- helib::Ctxt - ciphertext representing A <= B
◆ secureLT() [2/2]
helib::Ctxt PrivPointUtil::secureLT |
( |
Encryptor & |
encryptor, |
|
|
int |
maxBits, |
|
|
int |
nSlots, |
|
|
helib::Ctxt |
a, |
|
|
helib::Ctxt |
b |
|
) |
| |
Conducts secure less than or equal to operation between two ciphertexts (for Y-Node). Implements the secure comparison by Aloufi et. al.
- Parameters
-
Encryptor | &encryptor - encryptor object |
int | maxBits - bit-length |
int | nSlots - ciphertext slots |
helib::Ctxt | - binary value A, encrypted as a ciphertext |
helib::Ctxt | - binary value B, encrypted as a ciphertext |
- Returns
- helib::Ctxt - ciphertext representing A <= B
The documentation for this class was generated from the following files: