Code base obscuration (for images) 1.0
It implements different obscuration methods on portable images (.pgm and .ppm)
Loading...
Searching...
No Matches
Paillier_model.hpp
Go to the documentation of this file.
1
11#ifndef PAILLIER_MODEL
12#define PAILLIER_MODEL
13
14#include <stdio.h>
18
32{
33private:
34 uint64_t lambda; //<! lambda used in the Paillier cryptosystem in privateKey
35 uint64_t n; //<! n used in the Paillier cryptosystem in public key
36 uint64_t mu; //<! mu used in the Paillier cryptosystem in privateKey
37 uint64_t g; //<! g used in the Paillier cryptosystem in public key
38 uint64_t p; //<! prime number to obtain n
39 uint64_t q; //<! prime number to obtain n
40 PaillierPrivateKey privateKey; //<! The private key for decryption PaillierPublicKey publicKey
41 PaillierPublicKey publicKey; //<! The public key for encryption
42 Paillier<uint64_t, uint64_t> paillier_generation_key; //<! The Paillier instance for key generation
43
44 static PaillierModel *instancePtr; //<! The singleton instance of the PaillierModel class
45
55
56public:
63 PaillierModel(const PaillierModel &obj) = delete;
64
74 {
75 if (instancePtr == NULL)
76 {
77 instancePtr = new PaillierModel();
78 return instancePtr;
79 }
80 else
81 {
82 return instancePtr;
83 }
84 };
85
86 // Getters
93 uint64_t getLambda() const;
94
101 uint64_t getN() const;
102
109 uint64_t getMu() const;
110
117 uint64_t getG() const;
124 uint64_t getP() const;
125
132 uint64_t getQ() const;
133
141
149
157
158 // Setters
165 void setLambda(uint64_t value);
172 void setN(uint64_t value);
179 void setMu(uint64_t value);
186 void setG(uint64_t value);
193 void setP(uint64_t value);
200 void setQ(uint64_t value);
222
229};
230
231#endif // PAILLIER_MODEL
This file contains the Paillier cryptosystem implementation in C++.
Header of the Private key class in the Paillier cryptosystem.
Header of the Public key in the Paillier cryptosystem.
This class implements the Paillier cryptosystem.
Definition Paillier.hpp:33
This class represents a singleton model for the Paillier cryptosystem.
Definition Paillier_model.hpp:32
void setN(uint64_t value)
Setter function for the n variable.
Definition Paillier_model.cpp:36
void setPrivateKey(PaillierPrivateKey value)
Setter function for the private key.
Definition Paillier_model.cpp:47
uint64_t getQ() const
Getter function for the q variable.
Definition Paillier_model.cpp:29
void setMu(uint64_t value)
Setter function for the mu variable.
Definition Paillier_model.cpp:37
void setPublicKey(PaillierPublicKey value)
Setter function for the public key.
Definition Paillier_model.cpp:54
PaillierPublicKey getPublicKey() const
Getter function for the public key.
Definition Paillier_model.cpp:32
Paillier< uint64_t, uint64_t > getPaillierGenerationKey() const
Getter function for the Paillier instance used for key generation.
Definition Paillier_model.cpp:30
static PaillierModel * getInstance()
Static function to get the singleton instance of the PaillierModel class.
Definition Paillier_model.hpp:73
void setG(uint64_t value)
Setter function for the g variable.
Definition Paillier_model.cpp:38
~PaillierModel()
Destructor for the PaillierModel class.
PaillierModel(const PaillierModel &obj)=delete
Deleted copy constructor to prevent copying of the singleton instance.
void setP(uint64_t value)
Setter function for the p variable.
Definition Paillier_model.cpp:39
uint64_t getLambda() const
Getter function for the lambda variable.
Definition Paillier_model.cpp:24
uint64_t getG() const
Getter function for the g variable.
Definition Paillier_model.cpp:27
void setQ(uint64_t value)
Setter function for the q variable.
Definition Paillier_model.cpp:40
uint64_t getN() const
Getter function for the n variable.
Definition Paillier_model.cpp:25
uint64_t getMu() const
Getter function for the mu variable.
Definition Paillier_model.cpp:26
void setLambda(uint64_t value)
Setter function for the lambda variable.
Definition Paillier_model.cpp:35
uint64_t getP() const
Getter function for the p variable.
Definition Paillier_model.cpp:28
PaillierPrivateKey getPrivateKey() const
Getter function for the private key.
Definition Paillier_model.cpp:31
void setPaillierGenerationKey(Paillier< uint64_t, uint64_t > value)
Setter function for the Paillier instance used for key generation.
Definition Paillier_model.cpp:42
Class representing the private key in the Paillier cryptosystem.
Definition Paillier_private_key.hpp:27
Class representing the public key in the Paillier cryptosystem.
Definition Paillier_public_key.hpp:24