34 namespace PrivateRecommendationsUtils {
40 paillierCryptoProvider(paillierCryptoProvider),
41 dgkCryptoProvider(dgkCryptoProvider) {
48 this->
b = zModTwoPowL;
60 if (this->
b.GetBit(i) == 0) {
DgkCiphertext Ciphertext
Provide public access to the T_Ciphertext type.
Implementation of the public-key DGK Cryptosystem.
Ciphertext GetEncryptedOne(const bool randomized=true) const
Returns [1].
Ciphertext GetEncryptedZero(const bool randomized=true) const
Returns [0].
DgkComparisonClient(const Paillier &paillierCryptoProvider, const Dgk &dgkCryptoProvider)
Constructor.
Paillier::Ciphertext ConvertToPaillier(const Dgk::Ciphertext &dgkCiphertext) const
Converts to .
Paillier::Ciphertext ComputeDiPSP(const Dgk::Ciphertext &CiPSP) const
Computes .
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.
Definition of class DgkComparisonServer.
Dgk::Ciphertext GetBi(const size_t i) const
Extracts bit i from and encrypts it.
const Paillier & paillierCryptoProvider
Reference to the Paillier crypto provider.
bool IsEncryptedZero(const Ciphertext &ciphertext) const
Determines if ciphertext contains an encryption of 0 or not.
Implementation of the public-key Paillier Cryptosystem.
std::shared_ptr< const DgkComparisonServer > dgkComparisonServer
A reference to the DgkComparisonServer.
void DebugDgkEncryption(const Dgk::Ciphertext &input) const
Prints 0 if the received encryption is [0] and 1 otherwise.
BigInteger b
The term of the comparison.
Definition of class DgkComparisonClient.
void SetServer(const std::shared_ptr< DgkComparisonServer > &dgkComparisonServer)
Setter for this->dgkComparisonServer.
Dgk::Ciphertext GetTb(const Dgk::Ciphertext &tau, const size_t i) const
Computes for .
void SetZModTwoPowL(const BigInteger &zModTwoPowL)
Set before the comparison protocol is initiated.
const Dgk & dgkCryptoProvider
Reference to the DGK crypto provider.