) verifyArgsDictRandomized = {} randomizedIncorrectSigIndices = [] for sigIndex in range(0, (numValidSigs + numInvalidSigs)): verifyArgsDictRandomized[sigIndex] = sigsDict[ randomizedIndices[sigIndex]] if (randomizedIndices[sigIndex] in realIncorrectSigIndices): randomizedIncorrectSigIndices.append(sigIndex) verifyFuncArgs = list(verifyArgsDictRandomized[0].keys()) startTime = time.clock() incorrectSigIndices = run_Ind(verifyArgsDictRandomized, groupParamArg, verifyFuncArgs) endTime = time.clock() result = ((endTime - startTime) / trials) * time_in_ms TIMER += result TOTAL_SIGS = float(numValidSigs + numInvalidSigs) SIGS_PER_SECOND = float((TOTAL_SIGS * 1000.0) / (float(result))) updateBucketList(bucketListSigsPerSec, (TIMER - result), result, SIGS_PER_SECOND) percentInvalid = (float(numInvalidSigs) / TOTAL_SIGS) updateBucketList(bucketListInvalidSigs, (TIMER - result), result, percentInvalid)
startTime = time.clock() incorrectSigIndices = run_Batch(sigsDict, groupParamArg, verifyFuncArgs, False) endTime = time.clock() result = (endTime - startTime) * time_in_ms #print("batch is ", result) if (incorrectSigIndices != []): sys.exit("Batch verification returned invalid signatures.") batchResultsTimes[programIteration][cycle] = ( float(result) / float(cycle+1) ) startTime = time.clock() incorrectSigIndices = run_Ind(sigsDict, groupParamArg, verifyFuncArgs) endTime = time.clock() result = (endTime - startTime) * time_in_ms #print("ind is ", result) if (incorrectSigIndices != []): sys.exit("Ind. verification returned invalid signatures.") indResultsTimes[programIteration][cycle] = ( float(result) / float(cycle+1) ) batchResultsString = getResults(batchResultsTimes) indResultsString = getResults(indResultsTimes)
incorrectSigIndices = run_Batch(sigsDict, groupParamArg, verifyFuncArgs, False) endTime = time.clock() result = (endTime - startTime) * time_in_ms if (incorrectSigIndices != []): print(incorrectSigIndices) sys.exit("Batch verification returned invalid signatures.") batchResultsTimes = (float(result) / float(cycle + 1)) currentBatchOutputString = str(batchResultsTimes) + "," batchOutputFile.write(currentBatchOutputString) startTime = time.clock() incorrectSigIndices = run_Ind(sigsDict, groupParamArg, verifyFuncArgs) endTime = time.clock() result = (endTime - startTime) * time_in_ms if (incorrectSigIndices != []): sys.exit("Ind. verification returned invalid signatures.") indResultsTimes = (float(result) / float(cycle + 1)) currentIndOutputString = str(indResultsTimes) + "," indOutputFile.write(currentIndOutputString) batchOutputFile.write("\n") indOutputFile.write("\n") batchOutputFile.close()
if (preRandomizedIndices != []): sys.exit("Problems with randomly shuffling the valid and invalid signatures.") verifyArgsDictRandomized = {} randomizedIncorrectSigIndices = [] for sigIndex in range(0, (numValidSigs + numInvalidSigs)): verifyArgsDictRandomized[sigIndex] = sigsDict[randomizedIndices[sigIndex]] if (randomizedIndices[sigIndex] in realIncorrectSigIndices): randomizedIncorrectSigIndices.append(sigIndex) verifyFuncArgs = list(verifyArgsDictRandomized[0].keys()) startTime = time.clock() incorrectSigIndices = run_Ind(verifyArgsDictRandomized, groupParamArg, verifyFuncArgs) endTime = time.clock() result = ( (endTime - startTime) / trials) * time_in_ms TIMER += result TOTAL_SIGS = float(numValidSigs + numInvalidSigs) SIGS_PER_SECOND = float ( (TOTAL_SIGS * 1000.0) / (float(result)) ) updateBucketList(bucketListSigsPerSec, (TIMER - result), result, SIGS_PER_SECOND) percentInvalid = (float(numInvalidSigs) / TOTAL_SIGS) updateBucketList(bucketListInvalidSigs, (TIMER - result), result, percentInvalid) randomizedIncorrectSigIndices.sort()