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))),
63 std::deque<Dgk::Ciphertext> e;
66 if (s == hatRBits[
l - 1]) {
70 if (hatRBits[
l - 1] == 0) {
76 e.emplace_front(hatDBits[
l - 1] * blindingFactorContainer.
R[
l]);
83 e.emplace_front(blindingFactorContainer.
encryptedR[
l]);
89 for (
long i = static_cast<long>(this->
l - 2); i >= 0; --i) {
91 if (s == hatRBits[i]) {
101 e.emplace_front(c * blindingFactorContainer.
R[i + 1]);
106 e.emplace_front(blindingFactorContainer.
encryptedR[i + 1]);
122 e.emplace_front(blindingFactorContainer.
encryptedR[0]);
126 e.emplace_front(sigma * blindingFactorContainer.
R[0]);
PaillierCiphertext 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].
Definition of class DgkComparisonClient.
virtual Ciphertext RandomizeCiphertext(const Ciphertext &ciphertext) const
Randomize encrypted number with a self-generated random value.
std::weak_ptr< const DgkComparisonClient > dgkComparisonClient
A reference to the DgkComparisonClient.
size_t l
Bitsize of comparison operands.
void SetClient(const std::shared_ptr< DgkComparisonClient > &dgkComparisonClient)
Setter for this->dgkComparisonClient.
Paillier::Ciphertext encryptedMinusTwoPowL
const Dgk & dgkCryptoProvider
Reference to the DGK crypto provider.
Paillier::Ciphertext ComputeLambda(const std::deque< long > &hatRBits, const BigInteger &s)
Compute .
RandomizerCache< BlindingFactorContainer > blindingFactorCache
Blinding factor cache instance.
DgkComparisonServer(const Paillier &paillierCryptoProvider, const Dgk &dgkCryptoProvider, const std::string &configurationPath)
Constructor.
Permutation class which implements the Fisher-Yates (Knuth) shuffle algorithm.
std::deque< BigInteger > R
bits
Implementation of the public-key Paillier Cryptosystem.
Definition of class DgkComparisonServer.
Stores precomputed random data.
std::deque< typename T_CryptoProvider::Ciphertext > encryptedR
bits
void Permute(T_DataType &vector) const
Applies the permutations to the input vector.
Comparison blinding factor cache parameter container struct.