Code base obscuration (for images) 1.0
It implements different obscuration methods on portable images (.pgm and .ppm)
Loading...
Searching...
No Matches
PaillierModel Class Reference

This class represents a singleton model for the Paillier cryptosystem. More...

#include <Paillier_model.hpp>

Public Member Functions

 PaillierModel (const PaillierModel &obj)=delete
 Deleted copy constructor to prevent copying of the singleton instance.
 
uint64_t getLambda () const
 Getter function for the lambda variable.
 
uint64_t getN () const
 Getter function for the n variable.
 
uint64_t getMu () const
 Getter function for the mu variable.
 
uint64_t getG () const
 Getter function for the g variable.
 
uint64_t getP () const
 Getter function for the p variable.
 
uint64_t getQ () const
 Getter function for the q variable.
 
Paillier< uint64_t, uint64_t > getPaillierGenerationKey () const
 Getter function for the Paillier instance used for key generation.
 
PaillierPrivateKey getPrivateKey () const
 Getter function for the private key.
 
PaillierPublicKey getPublicKey () const
 Getter function for the public key.
 
void setLambda (uint64_t value)
 Setter function for the lambda variable.
 
void setN (uint64_t value)
 Setter function for the n variable.
 
void setMu (uint64_t value)
 Setter function for the mu variable.
 
void setG (uint64_t value)
 Setter function for the g variable.
 
void setP (uint64_t value)
 Setter function for the p variable.
 
void setQ (uint64_t value)
 Setter function for the q variable.
 
void setPaillierGenerationKey (Paillier< uint64_t, uint64_t > value)
 Setter function for the Paillier instance used for key generation.
 
void setPrivateKey (PaillierPrivateKey value)
 Setter function for the private key.
 
void setPublicKey (PaillierPublicKey value)
 Setter function for the public key.
 
 ~PaillierModel ()
 Destructor for the PaillierModel class.
 

Static Public Member Functions

static PaillierModelgetInstance ()
 Static function to get the singleton instance of the PaillierModel class.
 

Detailed Description

This class represents a singleton model for the Paillier cryptosystem.

It contains the private and public keys, as well as the Paillier generation key. It also contains the parameters of the Paillier cryptosystem: lambda, n, mu, g, p, and q. The Paillier cryptosystem is an asymmetric encryption algorithm that allows for homomorphic addition and multiplication of encrypted data. This class provides a singleton instance of the Paillier cryptosystem, allowing for easy access and management of the public and private keys, as well as the encryption and decryption functions.

Author
Katia Auxilien
Date
28 may 2024, 13:48:00

Constructor & Destructor Documentation

◆ PaillierModel()

PaillierModel::PaillierModel ( const PaillierModel & obj)
delete

Deleted copy constructor to prevent copying of the singleton instance.

Parameters
objInstance of PaillierModel.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ ~PaillierModel()

PaillierModel::~PaillierModel ( )

Destructor for the PaillierModel class.

Author
Katia Auxilien
Date
28 may 2024, 13:48:00

Member Function Documentation

◆ getG()

uint64_t PaillierModel::getG ( ) const

Getter function for the g variable.

Returns
uint64_t The value of g
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ getInstance()

static PaillierModel * PaillierModel::getInstance ( )
inlinestatic

Static function to get the singleton instance of the PaillierModel class.

This function checks if the singleton instance has already been created, and if not, creates a new instance. The instance is then returned.

Returns
PaillierModel* The singleton instance of the PaillierModel class.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ getLambda()

uint64_t PaillierModel::getLambda ( ) const

Getter function for the lambda variable.

Returns
uint64_t The value of lambda
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ getMu()

uint64_t PaillierModel::getMu ( ) const

Getter function for the mu variable.

Returns
uint64_t The value of mu.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ getN()

uint64_t PaillierModel::getN ( ) const

Getter function for the n variable.

Returns
uint64_t The value of n.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ getP()

uint64_t PaillierModel::getP ( ) const

Getter function for the p variable.

Returns
uint64_t The value of p.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ getPaillierGenerationKey()

Paillier< uint64_t, uint64_t > PaillierModel::getPaillierGenerationKey ( ) const

Getter function for the Paillier instance used for key generation.

Returns
Paillier<uint64_t,uint64_t> The Paillier instance used for key generation.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ getPrivateKey()

PaillierPrivateKey PaillierModel::getPrivateKey ( ) const

Getter function for the private key.

Returns
PaillierPrivateKey The private key.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ getPublicKey()

PaillierPublicKey PaillierModel::getPublicKey ( ) const

Getter function for the public key.

Returns
PaillierPublicKey The public key
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ getQ()

uint64_t PaillierModel::getQ ( ) const

Getter function for the q variable.

Returns
uint64_t The value of q.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ setG()

void PaillierModel::setG ( uint64_t value)

Setter function for the g variable.

Parameters
[in]valueThe new value for g.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ setLambda()

void PaillierModel::setLambda ( uint64_t value)

Setter function for the lambda variable.

Parameters
[in]valueThe new value for lambda.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ setMu()

void PaillierModel::setMu ( uint64_t value)

Setter function for the mu variable.

Parameters
[in]valueThe new value for mu.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ setN()

void PaillierModel::setN ( uint64_t value)

Setter function for the n variable.

Parameters
[in]valueThe new value for n.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ setP()

void PaillierModel::setP ( uint64_t value)

Setter function for the p variable.

Parameters
[in]valueThe new value for p.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ setPaillierGenerationKey()

void PaillierModel::setPaillierGenerationKey ( Paillier< uint64_t, uint64_t > value)

Setter function for the Paillier instance used for key generation.

Parameters
[in]valueThe new Paillier instance used for key generation.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ setPrivateKey()

void PaillierModel::setPrivateKey ( PaillierPrivateKey value)

Setter function for the private key.

Parameters
[in]valueThe new private key.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ setPublicKey()

void PaillierModel::setPublicKey ( PaillierPublicKey value)

Setter function for the public key.

Parameters
[in]valueThe new public key.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00

◆ setQ()

void PaillierModel::setQ ( uint64_t value)

Setter function for the q variable.

Parameters
[in]valueThe new value for q.
Author
Katia Auxilien
Date
28 may 2024, 13:48:00