9#ifndef PAILLIERCONTROLLER
10#define PAILLIERCONTROLLER
47 bool endsWith(
const std::string &str,
const std::string &suffix);
67 bool isPrime(uint64_t n, uint64_t i = 2);
Header of singleton of https://www.geeksforgeeks.org/implementation-of-singleton-class-in-cpp/ using ...
Superclass of Paillier main that contains common methods between subclasses.
Definition PaillierController.hpp:31
PaillierModel * getModel()
Gets the model.
Definition PaillierController.hpp:111
commandLineInterface * getView()
Gets the view.
Definition PaillierController.hpp:124
bool endsWith(const std::string &str, const std::string &suffix)
Checks if the given string ends with the specified suffix.
Definition PaillierController.cpp:33
PaillierModel * model
Instance of PaillierModel.
Definition PaillierController.hpp:35
void setCKeyFile(char *newCKeyFile)
Sets the key file.
Definition PaillierController.cpp:26
void readKeyFile(bool isEncryption)
Reads the key file.
Definition PaillierController.cpp:175
commandLineInterface * view
Instance of commandLineInterface.
Definition PaillierController.hpp:36
void convertToLower(char *arg_in[], int size_arg_in)
Converts the given arguments to lower case.
Definition PaillierController.cpp:45
void generateAndSaveKeyPair()
Generates and saves the key pair.
Definition PaillierController.cpp:97
PaillierController()
Constructor for PaillierController.
Definition PaillierController.cpp:18
uint64_t check_p_q_arg(char *arg)
Checks if the given argument is a prime number.
Definition PaillierController.cpp:71
const char * getCKeyFile() const
Gets the key file.
Definition PaillierController.cpp:21
~PaillierController()
Destructor for PaillierController.
Definition PaillierController.cpp:19
char * c_key_file
Pointer to the key file.
Definition PaillierController.hpp:33
virtual void init()
Initializes the controller.
Definition PaillierController.hpp:85
bool isPrime(uint64_t n, uint64_t i=2)
Checks if the given number is prime.
Definition PaillierController.cpp:59
This class represents a singleton model for the Paillier cryptosystem.
Definition Paillier_model.hpp:32
static PaillierModel * getInstance()
Static function to get the singleton instance of the PaillierModel class.
Definition Paillier_model.hpp:73
This class provides a command line interface for the Paillier cryptosystem. It is a singleton class,...
Definition commandLineInterface.hpp:26
static commandLineInterface * getInstance()
This function returns the singleton instance of the class.
Definition commandLineInterface.hpp:51
This file contains the command line interface for the Paillier cryptosystem.