|
@@ -70,6 +70,8 @@ void make_vote(
|
|
|
std::uniform_int_distribution<int> numVoteDistribution(0, numClients);
|
|
|
size_t numVotes = numVoteDistribution(rng);
|
|
|
std::vector<size_t> bandwidthData(2);
|
|
|
+ bandwidthData[0] = 0;
|
|
|
+ bandwidthData[1] = 0;
|
|
|
|
|
|
// Make the correct number of new votes, but shuffle where they go
|
|
|
std::vector<Scalar> votes;
|
|
@@ -138,7 +140,12 @@ bool make_reputation_proof(
|
|
|
std::mutex& usageMtx,
|
|
|
const std::string& usageFilename)
|
|
|
{
|
|
|
- std::vector<size_t> bandwidthData(2);
|
|
|
+ std::vector<double> timingData(2);
|
|
|
+ std::vector<size_t> bandwidthData(2), bandwidthDataMidA, bandwidthDataMidB, bandwidthDataMidC;
|
|
|
+ bandwidthData[0] = 0;
|
|
|
+ bandwidthData[1] = 0;
|
|
|
+
|
|
|
+ std::string extraOutput = outputFilename + ".extra";
|
|
|
|
|
|
std::vector<size_t> bandwidthDataBefore = get_server_log_data(civetServer.getContext());
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeBefore = std::chrono::high_resolution_clock::now();
|
|
@@ -148,6 +155,13 @@ bool make_reputation_proof(
|
|
|
std::vector<Proof> generatorProof;
|
|
|
Twistpoint freshGenerator = get_generator(rng, serverIPs, serverPorts, true, generatorProof, bandwidthData);
|
|
|
|
|
|
+ // EXTRA
|
|
|
+ bandwidthDataMidA = get_server_log_data(civetServer.getContext());
|
|
|
+ bandwidthDataMidB[0] += bandwidthDataMidA[0] - bandwidthDataBefore[0];
|
|
|
+ bandwidthDataMidB[1] += bandwidthDataMidA[1] - bandwidthDataBefore[1];
|
|
|
+
|
|
|
+ write_log_data(outputMtx, extraOutput, timingData, bandwidthDataMidB);
|
|
|
+
|
|
|
// Load fresh generator into client object
|
|
|
prsonaClient->receive_fresh_generator(generatorProof, freshGenerator);
|
|
|
|
|
@@ -158,6 +172,13 @@ bool make_reputation_proof(
|
|
|
std::vector<Proof> encryptedScoreProof;
|
|
|
EGCiphertext encryptedScore = get_server_committed_val<EGCiphertext>(rng, serverIPs, serverPorts, REQUEST_CLIENT_TALLY_URI, REQUEST_CLIENT_TALLY_COMMITMENT_URI, encryptedScoreProof, shortTermPublicKey, bandwidthData);
|
|
|
|
|
|
+ // EXTRA
|
|
|
+ bandwidthDataMidC = get_server_log_data(civetServer.getContext());
|
|
|
+ bandwidthDataMidB[0] += bandwidthDataMidC[0] - bandwidthDataMidA[0];
|
|
|
+ bandwidthDataMidB[1] += bandwidthDataMidC[1] - bandwidthDataMidA[1];
|
|
|
+
|
|
|
+ write_log_data(outputMtx, extraOutput, timingData, bandwidthDataMidB);
|
|
|
+
|
|
|
// Load this current encrypted score into client object
|
|
|
prsonaClient->receive_vote_tally(encryptedScoreProof, encryptedScore);
|
|
|
|
|
@@ -173,11 +194,18 @@ bool make_reputation_proof(
|
|
|
// Send that proof to a chosen client (and set up a file to receive whether or not the client accepted the proof)
|
|
|
char *responseFile = send_item(rng, target, targetPort, VERIFY_REPUTATION_PROOF_URI, data, true, bandwidthData);
|
|
|
|
|
|
+ // EXTRA
|
|
|
+ bandwidthDataMidA = get_server_log_data(civetServer.getContext());
|
|
|
+ bandwidthDataMidB[0] += bandwidthDataMidA[0] - bandwidthDataMidC[0];
|
|
|
+ bandwidthDataMidB[1] += bandwidthDataMidA[1] - bandwidthDataMidC[1];
|
|
|
+
|
|
|
+ write_log_data(outputMtx, extraOutput, timingData, bandwidthData);
|
|
|
+ write_log_data(outputMtx, extraOutput, timingData, bandwidthDataMidB);
|
|
|
+
|
|
|
clock_t cpuTimeAfter = clock();
|
|
|
std::chrono::high_resolution_clock::time_point wallTimeAfter = std::chrono::high_resolution_clock::now();
|
|
|
std::vector<size_t> bandwidthDataAfter = get_server_log_data(civetServer.getContext());
|
|
|
|
|
|
- std::vector<double> timingData(2);
|
|
|
timingData[0] = std::chrono::duration_cast<std::chrono::duration<double>>(wallTimeAfter - wallTimeBefore).count();
|
|
|
timingData[1] = ((double)(cpuTimeAfter - cpuTimeBefore)) / CLOCKS_PER_SEC;
|
|
|
|
|
@@ -1056,6 +1084,8 @@ void PrsonaClientWebSocketHandler::verify_reputation_proof(
|
|
|
Twistpoint shortTermPublicKey;
|
|
|
Scalar threshold;
|
|
|
std::vector<size_t> bandwidthData(2);
|
|
|
+ bandwidthData[0] = 0;
|
|
|
+ bandwidthData[1] = 0;
|
|
|
|
|
|
// Un-serialize the reputation proof
|
|
|
std::ifstream file(filename);
|