예제 #1
0
	randomizedIndices = shuffle(preRandomizedIndices)

	if (preRandomizedIndices != []):
		sys.exit("Problems with randomly shuffling the valid and invalid signatures.")

	verifyArgsDictRandomized = {}
	randomizedIncorrectSigIndices = []

	for sigIndex in range(0, 20):
		verifyArgsDictRandomized[sigIndex] = sigsDict[randomizedIndices[sigIndex]]
		if (randomizedIndices[sigIndex] in realIncorrectSigIndices):
			randomizedIncorrectSigIndices.append(sigIndex)

	randomizedIncorrectSigIndices.sort()

	print(randomizedIncorrectSigIndices)

	verifyFuncArgs = list(verifyArgsDictRandomized[0].keys())

	incorrectSigIndices = run_Batch(verifyArgsDictRandomized, groupParamArg, verifyFuncArgs)
	incorrectSigIndices.sort()

	print(incorrectSigIndices)

	del incorrectSigIndices

	incorrectSigIndices = run_Ind(verifyArgsDictRandomized, groupParamArg, verifyFuncArgs)
	incorrectSigIndices.sort()

	print(incorrectSigIndices)
예제 #2
0
	for initIndex in range(0, NUM_PROGRAM_ITERATIONS):
		batchResultsTimes[initIndex] = {}
		indResultsTimes[initIndex] = {}

	for programIteration in range(0, NUM_PROGRAM_ITERATIONS):

		print("program iteration ", programIteration)

		for cycle in range(0, NUM_CYCLES):

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

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

			result = (endTime - startTime) * time_in_ms

			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
예제 #3
0
    indOutputFile = open(indResultsFile, 'w')

    for programIteration in range(0, NUM_PROGRAM_ITERATIONS):

        #print("program iteration ", programIteration)

        for cycle in range(0, NUM_CYCLES):

            #print("\tcycle number ", cycle)

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

            startTime = time.clock()
            incorrectSigIndices = run_Batch(sigsDict, groupParamArg,
                                            verifyFuncArgs)
            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)
예제 #4
0
	randomizedIndices = shuffle(preRandomizedIndices)

	if (preRandomizedIndices != []):
		sys.exit("Problems with randomly shuffling the valid and invalid signatures.")

	verifyArgsDictRandomized = {}
	randomizedIncorrectSigIndices = []

	for sigIndex in range(0, 20):
		verifyArgsDictRandomized[sigIndex] = sigsDict[randomizedIndices[sigIndex]]
		if (randomizedIndices[sigIndex] in realIncorrectSigIndices):
			randomizedIncorrectSigIndices.append(sigIndex)

	randomizedIncorrectSigIndices.sort()

	print(randomizedIncorrectSigIndices)

	verifyFuncArgs = list(verifyArgsDictRandomized[0].keys())

	incorrectSigIndices = run_Batch(verifyArgsDictRandomized, groupParamArg, verifyFuncArgs)
	incorrectSigIndices.sort()

	print(incorrectSigIndices)

	del incorrectSigIndices

	incorrectSigIndices = run_Ind(verifyArgsDictRandomized, groupParamArg, verifyFuncArgs)
	incorrectSigIndices.sort()

	print(incorrectSigIndices)