-
-class CloudComm {
- static final int SALT_SIZE = 8;
- static final int TIMEOUT_MILLIS = 5000; // 100
- static final int IV_SIZE = 16;
-
- /** Sets the size for the HMAC. */
- static final int HMAC_SIZE = 32;
-
- String baseurl;
- SecretKeySpec key;
- Mac mac;
- String password;
- SecureRandom random;
- char salt[];
- Table table;
- int listeningPort = -1;
- Thread localServerThread = NULL;
- bool doEnd = false;
-
- TimingSingleton timer = NULL;
-
- /**
- * Empty Constructor needed for child class.
- */
- CloudComm() {
- timer = TimingSingleton.getInstance();
- }
-
- /**
- * Constructor for actual use. Takes in the url and password.
- */
- CloudComm(Table _table, String _baseurl, String _password, int _listeningPort) {
- timer = TimingSingleton.getInstance();
- this.table = _table;
- this.baseurl = _baseurl;
- this.password = _password;
- this.random = new SecureRandom();
- this.listeningPort = _listeningPort;
-
- if (this.listeningPort > 0) {
- localServerThread = new Thread(new Runnable() {
- void run() {
- localServerWorkerFunction();
- }
- });
- localServerThread.start();
- }
+/**
+ * Constructor for actual use. Takes in the url and password.
+ */
+CloudComm::CloudComm(Table _table, String _baseurl, String _password, int _listeningPort) :
+ baseurl(_baseurl),
+ key(NULL),
+ mac(NULL),
+ password(_password),
+ random(new SecureRandom()),
+ salt(NULL),
+ table(_table),
+ listeningPort(_listeningPort),
+ localServerThread(NULL),
+ doEnd(false)
+ timer(TimingSingleton.getInstance()) {
+ if (this.listeningPort > 0) {
+ localServerThread = new Thread(new Runnable() {
+ void run() {
+ localServerWorkerFunction();
+ }
+ });
+ localServerThread.start();