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())

			bID1 = InitBenchmark()

			StartBenchmark(bID1, [RealTime])
			incorrectSigIndices = runBLS_Batch(verifyArgsDictRandomized, groupParamArg, verifyFuncArgs)
			EndBenchmark(bID1)

			result = (GetBenchmark(bID1, RealTime) / trials) * time_in_ms

			TIMER += result
			TOTAL_SIGS = float(numValidSigs + numInvalidSigs)
			SIGS_PER_SECOND = float ( (TOTAL_SIGS * 1000.0) / (float(result)) )

			#outputString += str(TIMER) + " " + str(SIGS_PER_SECOND) + "\n"

			updateBucketList(bucketListSigsPerSec, (TIMER - result), result, SIGS_PER_SECOND)

			percentInvalid = (float(numInvalidSigs) / TOTAL_SIGS)

			#outputInvalidSigsString += str(TIMER) + " " + str(percentInvalid) + "\n"
Esempio n. 2
0
        print("program iteration ", programIteration)

        for cycle in range(0, NUM_CYCLES):

            print("cycle is ", cycle)

            sigsDict = {}
            loadDataFromDictInMemory(validDict, 0, (cycle + 1), sigsDict, 0)
            verifyFuncArgs = list(sigsDict[0].keys())

            #bID1 = InitBenchmark()
            #StartBenchmark(bID1, [RealTime])

            startTime = time.clock()
            incorrectSigIndices = runBLS_Batch(sigsDict, groupParamArg,
                                               verifyFuncArgs)
            endTime = time.clock()

            result = (endTime - startTime) * time_in_ms

            #print("batch is ", result)

            #EndBenchmark(bID1)
            #result = (GetBenchmark(bID1, RealTime) / trials) * time_in_ms

            if (incorrectSigIndices != []):
                sys.exit("Batch verification returned invalid signatures.")

            batchResultsTimes[programIteration][cycle] = (float(result) /
                                                          float(cycle + 1))
            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())

            bID1 = InitBenchmark()

            StartBenchmark(bID1, [RealTime])
            incorrectSigIndices = runBLS_Batch(verifyArgsDictRandomized,
                                               groupParamArg, verifyFuncArgs)
            EndBenchmark(bID1)

            result = (GetBenchmark(bID1, RealTime) / trials) * time_in_ms

            TIMER += result
            TOTAL_SIGS = float(numValidSigs + numInvalidSigs)
            SIGS_PER_SECOND = float((TOTAL_SIGS * 1000.0) / (float(result)))

            #outputString += str(TIMER) + " " + str(SIGS_PER_SECOND) + "\n"

            updateBucketList(bucketListSigsPerSec, (TIMER - result), result,
                             SIGS_PER_SECOND)

            percentInvalid = (float(numInvalidSigs) / TOTAL_SIGS)
Esempio n. 4
0
		for cycle in range(0, NUM_CYCLES):

			print("cycle is ", cycle)

			sigsDict = {}
			loadDataFromDictInMemory(validDict, 0, (cycle+1), sigsDict, 0)
			verifyFuncArgs = list(sigsDict[0].keys())



			#bID1 = InitBenchmark()
			#StartBenchmark(bID1, [RealTime])


			startTime = time.clock()
			incorrectSigIndices = runBLS_Batch(sigsDict, groupParamArg, verifyFuncArgs)
			endTime = time.clock()

			result = (endTime - startTime) * time_in_ms


			#print("batch is ", result)


			#EndBenchmark(bID1)
			#result = (GetBenchmark(bID1, RealTime) / trials) * time_in_ms




			if (incorrectSigIndices != []):