void Keyer::keying(KeyingParameters* kp, const Mat& a, const Mat &b, Mat &out) { this->kp = kp; prepareSize(a, b); matte = new Matte(fg.size()); computeMatte(); prepareOutput(out); }
int main(int argc, char *argv[]) { char *servhost = (char *)HOST; long port = PORT; unsigned long numOfBlocks = 0; int flag = 1; if (argc >= 2) { if (isalpha(argv[1][0]) || argv[1][0] == '?') { cout << "pclient [numOfBlocks = 10] [numOfChallenges=50] [Server Name = localhost] [Port = 8888]" << endl; exit(0); } else if(argv[1][0] == '-') flag= 0; else numOfBlocks = atoi(argv[1]); } int numOfChallenges = CHALLNUM; if (argc >=3) numOfChallenges = atoi(argv[2]); if (argc >=4) servhost = argv[3]; if (argc >= 5) if (atoi(argv[4]) > 1024) port = atoi(argv[4]); /* no of challenges in the challenge set */ unsigned l; unsigned long indexSize = getPrimeKeys(); if (numOfBlocks > 0 && numOfBlocks<indexSize) l = numOfBlocks; else l = BLOCKNUM; int sock = clientConnect(servhost, port); doHandshake(numOfChallenges, flag, sock); FILE *foutput = prepareOutput(servhost, l, flag); char output[1024] = {0}; bool res = false; uint64_t elapsed = 0; for (int i=0; i<numOfChallenges; i++) { elapsed = 0; if (flag) res = challengeResponse(sock, l, &elapsed); else res=FileRet(sock, &elapsed); if (res) snprintf(output, 15, "%s", "Data Verified"); else snprintf(output, 15, "%s", "Data lost"); fprintf(foutput, "%llu \t\t\t %s \n", elapsed, output); //write the results } fclose(foutput); closeSocket(sock); return 0; }