#include <server.h>
Public Member Functions | |
Server (const PaillierPublicKey &paillierPublicKey, const DgkPublicKey &dgkPublicKey) | |
Constructor. More... | |
~Server () | |
Destructor - void implementation. | |
Paillier::Ciphertext | SecureComparison (const Paillier::Ciphertext &a, const Paillier::Ciphertext &b) const |
Computes the relation between the inputs. More... | |
void | SetClient (const std::shared_ptr< const Client > &client) |
Sets a reference to the Privacy Service Provider. More... | |
const std::shared_ptr < SecureComparisonServer > & | GetSecureComparisonServer () const |
Getter for this->secureComparisonServer. More... | |
Private Member Functions | |
Server (Server const &) | |
Copy constructor - not implemented. | |
Server | operator= (Server const &) |
Copy assignment operator - not implemented. | |
Private Attributes | |
std::weak_ptr< const Client > | client |
A reference to the Client. | |
Paillier | paillierCryptoProvider |
Paillier crypto provider. | |
Dgk | dgkCryptoProvider |
DGK crypto provider. | |
const std::shared_ptr < SecureComparisonServer > | secureComparisonServer |
A reference to the SecureComparisonServer. | |
Static Private Attributes | |
static const std::string | configurationPath |
Service Provider configuration path. More... | |
Definition at line 51 of file secure_face_recognition/server.h.
SeComLib::SecureFaceRecognition::Server::Server | ( | const PaillierPublicKey & | paillierPublicKey, |
const DgkPublicKey & | dgkPublicKey | ||
) |
Constructor.
paillierPublicKey | The Paillier public key |
dgkPublicKey | The DGK public key |
Definition at line 45 of file secure_face_recognition/server.cpp.
const std::shared_ptr< SecureComparisonServer > & SeComLib::SecureFaceRecognition::Server::GetSecureComparisonServer | ( | ) | const |
Getter for this->secureComparisonServer.
Definition at line 80 of file secure_face_recognition/server.cpp.
Paillier::Ciphertext SeComLib::SecureFaceRecognition::Server::SecureComparison | ( | const Paillier::Ciphertext & | a, |
const Paillier::Ciphertext & | b | ||
) | const |
Computes the relation between the inputs.
a | Paillier encryption |
b | Paillier encryption |
To determine the minimum value, the server can compute \( [min] = [a + z_l (b - a)] = [a] ([y] \times ([b] [a]^{-1})) \) using an interactive protocol for the secure multiplication. Since this operation is rather expensive and the client already has the value \( d = 2^l + a - b + r \), the server can blind \( [y] \) with \( \eta \in_R \{0, 1\} \): if \( \eta = 1 \Rightarrow [\tilde{y}] = [1] [y]^{-1} \) else \( [\tilde{y}] = [y] \) and send it to the client. The client can decrypt \( [\tilde{y}] \) and compute \( [y d] \), which gets sent back to the server. The server now computes \( [\tilde{min}] = [b + y d - (r + 2^l) y] = [b] [yd] [y]^{-(r + 2^l)} \). If \( \eta = 1 \Rightarrow [min] = [\tilde{min}] \) else \( [min] = [a + b - \tilde{min}] = [a] [b] [\tilde{min}]^{-1} \)
Definition at line 56 of file secure_face_recognition/server.cpp.
void SeComLib::SecureFaceRecognition::Server::SetClient | ( | const std::shared_ptr< const Client > & | client | ) |
Sets a reference to the Privacy Service Provider.
client | a Client instance |
Definition at line 72 of file secure_face_recognition/server.cpp.
|
staticprivate |
Service Provider configuration path.
Set the configuration path.
Definition at line 82 of file secure_face_recognition/server.h.