示例#1
0
        )

    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_Sorted(verifyArgsDictRandomized,
                                           groupParamArg, verifyFuncArgs)
    incorrectSigIndices.sort()

    print(incorrectSigIndices)

    del incorrectSigIndices

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

    print(incorrectSigIndices)
示例#2
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_Sorted(verifyArgsDictRandomized, groupParamArg, verifyFuncArgs)
	incorrectSigIndices.sort()

	print(incorrectSigIndices)

	del incorrectSigIndices

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

	print(incorrectSigIndices)
			startTime = time.clock()
			incorrectSigIndices = run_Batch_Sorted(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)
			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()