34 namespace SecureFaceRecognitionUtils {
41 paillierCryptoProvider(paillierCryptoProvider),
42 dgkCryptoProvider(dgkCryptoProvider),
43 l(Utils::Config::GetInstance().GetParameter<size_t>(configurationPath +
".l")),
44 encryptedMinusTwoPowL(paillierCryptoProvider.EncryptIntegerNonrandom(BigInteger(-1) << static_cast<unsigned long>(l))) {
58 std::deque<Dgk::Ciphertext> hatDBits;
61 for (
size_t i = 0; i < this->
l; ++i) {
75 for (
size_t i = 0; i < this->
l + 1; ++i) {
PaillierCiphertext Ciphertext
Provide public access to the T_Ciphertext type.
Implementation of the public-key DGK Cryptosystem.
Definition of class DgkComparisonClient.
Ciphertext GetEncryptedZero(const bool randomized=true) const
Returns [0].
const Paillier & paillierCryptoProvider
Reference to the Paillier crypto provider.
const Dgk & dgkCryptoProvider
Reference to the DGK crypto provider.
virtual T_Ciphertext EncryptInteger(const BigInteger &plaintext) const
Encrypt an integer and apply randomization.
virtual Ciphertext RandomizeCiphertext(const Ciphertext &ciphertext) const
Randomize encrypted number with a self-generated random value.
Paillier::Ciphertext ComputeLambda(const std::deque< Dgk::Ciphertext > &e) const
Computes .
bool IsEncryptedZero(const Ciphertext &ciphertext) const
Determines if ciphertext contains an encryption of 0 or not.
Implementation of the public-key Paillier Cryptosystem.
size_t l
Bitsize of comparison operands.
void DebugDgkEncryption(const Dgk::Ciphertext &input) const
Prints 0 if the received encryption is [0] and 1 otherwise.
void SetHatD(const BigInteger &hatD)
Set before the comparison protocol is initiated.
Definition of class DgkComparisonServer.
DgkComparisonClient(const Paillier &paillierCryptoProvider, const Dgk &dgkCryptoProvider, const std::string &configurationPath)
Constructor.
Paillier::Ciphertext encryptedMinusTwoPowL
std::deque< Dgk::Ciphertext > GetHatDBits() const
Computes the encrypted bits of .
void SetServer(const std::shared_ptr< DgkComparisonServer > &dgkComparisonServer)
Setter for this->dgkComparisonServer.
std::shared_ptr< const DgkComparisonServer > dgkComparisonServer
A reference to the DgkComparisonServer.