Superclass of Paillier main that contains common methods between subclasses.
More...
#include <PaillierController.hpp>
Superclass of Paillier main that contains common methods between subclasses.
- Author
- Katia Auxilien
- Date
- 28 May 2024, 13:48:00
◆ PaillierController()
PaillierController::PaillierController |
( |
| ) |
|
|
protected |
Constructor for PaillierController.
This is the default constructor for PaillierController. It initializes the controller and its associated model and view.
- Author
- Katia Auxilien
- Date
- 30 April 2024
◆ ~PaillierController()
PaillierController::~PaillierController |
( |
| ) |
|
|
protected |
Destructor for PaillierController.
This is the destructor for PaillierController. It cleans up any resources allocated by the controller and its associated model and view.
- Author
- Katia Auxilien
- Date
- 30 April 2024
◆ check_p_q_arg()
uint64_t PaillierController::check_p_q_arg |
( |
char * | arg | ) |
|
|
protected |
Checks if the given argument is a prime number.
Verification of the argument in parameter, to see if it is indeed a number and if it is prime.
- Parameters
-
char | *arg The argument to check. |
- Author
- Katia Auxilien
- Date
- 30 April 2024
- Returns
- uint64_t The prime number if the argument is a prime number, 0 otherwise.
◆ convertToLower()
void PaillierController::convertToLower |
( |
char * | arg_in[], |
|
|
int | size_arg_in ) |
|
protected |
Converts the given arguments to lower case.
- Parameters
-
char | *arg_in[] The arguments to convert. |
int | size_arg_in The size of the arguments array. |
- Author
- Katia Auxilien
- Date
- 15 May 2024
◆ endsWith()
bool PaillierController::endsWith |
( |
const std::string & | str, |
|
|
const std::string & | suffix ) |
|
protected |
Checks if the given string ends with the specified suffix.
Verification of the argument in parameter, to see if it is indeed a file name ending with .?.
- Parameters
-
const | std::string &str The string to check. |
const | std::string &suffix The suffix to check for. |
- Author
- Katia Auxilien
- Date
- 30 April 2024
- Returns
- bool True if the string ends with the suffix, false otherwise.
◆ generateAndSaveKeyPair()
void PaillierController::generateAndSaveKeyPair |
( |
| ) |
|
Generates and saves the key pair.
This function generates a new key pair and saves it to the key file associated with this controller.
- Author
- Katia Auxilien
- Date
- 30 April 2024
◆ getCKeyFile()
const char * PaillierController::getCKeyFile |
( |
| ) |
const |
Gets the key file.
This function returns the key file associated with this controller.
- Author
- Katia Auxilien
- Date
- 30 April 2024
- Returns
- const char* The key file.
◆ getModel()
Gets the model.
This function returns a pointer to the PaillierModel associated with this controller.
- Author
- Katia Auxilien
- Date
- 30 April 2024
- Returns
- PaillierModel* The model.
◆ getView()
Gets the view.
This function returns a pointer to the commandLineInterface associated with this controller.
- Author
- Katia Auxilien
- Date
- 30 April 2024
- Returns
- commandLineInterface* The view.
◆ init()
virtual void PaillierController::init |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ isPrime()
bool PaillierController::isPrime |
( |
uint64_t | n, |
|
|
uint64_t | i = 2 ) |
|
protected |
Checks if the given number is prime.
- Parameters
-
uint64_t | n The number to check. |
uint64_t | i The starting index for the check. |
- Author
- Katia Auxilien
- Date
- 30 April 2024
- Returns
- bool True if the number is prime, false otherwise.
◆ readKeyFile()
void PaillierController::readKeyFile |
( |
bool | isEncryption | ) |
|
Reads the key file.
This function reads the key file associated with this controller and sets the model's public and private keys accordingly.
- Author
- Katia Auxilien
- Date
- 30 April 2024
- Parameters
-
bool | isEncryption True if the key is for encryption, false otherwise. |
◆ setCKeyFile()
void PaillierController::setCKeyFile |
( |
char * | newCKeyFile | ) |
|
Sets the key file.
This function sets the key file associated with this controller.
- Author
- Katia Auxilien
- Date
- 30 April 2024
- Parameters
-
char* | newCKeyFile The new key file. |
◆ c_key_file
char* PaillierController::c_key_file |
|
protected |
◆ model
◆ view