first commit

This commit is contained in:
valeh
2020-12-22 14:30:09 +02:00
commit 26b0ba5954
1832 changed files with 17777948 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
/**
* @file BluetoothModel.cpp
* @brief BluetoothModel implementation file
* */
#include "model.h"
BluetoothModel::BluetoothModel(char *ssid, char* voteID, unsigned char * rndBase64){
this->ssid = ssid;
this->voteID = voteID;
this->rndBase64 = rndBase64;
}

View File

@@ -0,0 +1,16 @@
/**
* @file ChoiceModel.cpp
* @brief ChoiceModel implementation file
* */
#include <vector>
#include "model.h"
ChoiceModel::ChoiceModel(char* ssid, char * authToken){
this->ssid = ssid;
this->authToken = authToken;
this->choices = NULL;
this->choice_list = new std::vector<choice_t>();
this->ballot = NULL;
}

View File

@@ -0,0 +1,21 @@
/**
* @file EncryptionModel.cpp
* @brief EncryptionModel implementation file
* */
#include "model.h"
EncryptionModel::EncryptionModel(char* ballot, char* ssid, char * authToken, const uint8_t keypem[], int keypem_length){
this->ballot = ballot;
this->ballotASN = NULL;
this->ballotHash = NULL;
this->ballotFileName = NULL;
this->ballotLength = 0;
this->rndBase64 = NULL;
this->authToken = authToken;
this->ssid = ssid;
this->keypem = keypem;
this->keypem_length = keypem_length;
this->election_id = NULL;
}

View File

@@ -0,0 +1,30 @@
/**
* @file SignatureModel.cpp
* @brief SignatureModel implementation file
* */
#include "string.h"
#include "model.h"
SignatureModel::SignatureModel(char* ssid, char * authToken, char* phone, char* id, unsigned char* ballotHash, size_t ballotLength, char* ballotFileName){
this->ssid = ssid;
this->authToken = authToken;
this->sscode = NULL;
memset(this->ID, 0, 12);
memset(this->phone, 0, 13);
strncpy(this->ID, id, 11);
strncpy(this->phone, phone, 12);
this->ballotHash = ballotHash;
this->ballotLength = ballotLength;
this->ballotFileName = ballotFileName;
this->SignedInfoHash = NULL;
this->signature = NULL;
this->Signature = NULL;
this->certificate = NULL;
this->SI_XML = NULL;
this->SP_XML = NULL;
this->SV_XML = NULL;
}

View File

@@ -0,0 +1,19 @@
/**
* @file UserModel.cpp
* @brief UserModel implementation file
* */
#include "string.h"
#include "model.h"
UserModel::UserModel(char* id, char* phone){
memset(this->ID, 0, 12);
memset(this->phone, 0, 12);
strncpy(this->ID, id, 11);
strncpy(this->phone, phone, 12);
ssid = NULL;
authToken = NULL;
sscode = NULL;
}

View File

@@ -0,0 +1,20 @@
/**
* @file VoteModel.cpp
* @brief VoteModel implementation file
* */
#include "string.h";
#include "model.h"
VoteModel::VoteModel(char* ssid, char* authToken, unsigned char* voteBase64, char* choices){
this->ssid = ssid;
this->authToken = authToken;
this->choices = choices;
this->voteBase64 = voteBase64;
this->voteID = NULL;
}

View File

@@ -0,0 +1,19 @@
/**
* @file ZipModel.cpp
* @brief ZipModel implementation file
* */
#include "string.h"
#include "model.h"
ZipModel::ZipModel(unsigned char* ballot, char* ballotFileName, size_t ballotLength, char* Signature){
this->ballot = ballot;
this->ballotFileName = ballotFileName;
this->ballotLength = ballotLength;
this->Signature = Signature;
this->authToken = NULL;
this->ssid = NULL;
this->voteBase64 = NULL;
}