- Added first attack analysis.

This commit is contained in:
ccremers 2006-07-01 09:48:06 +00:00
parent 7686ea4f64
commit b85d2e2270

View File

@ -2,7 +2,9 @@
import os import os
def analyze(file): firstbroken = {}
def analyze(file,bound):
claim = 0 claim = 0
correct = 0 correct = 0
@ -15,8 +17,16 @@ def analyze(file):
for l in fp.readlines(): for l in fp.readlines():
if l.startswith("claim"): if l.startswith("claim"):
claim = claim + 1 claim = claim + 1
dt = l.split('\t')
claimid = "%s,%s" % (dt[1],dt[2])
if l.find("\tFail\t") >= 0: if l.find("\tFail\t") >= 0:
attack = attack + 1 attack = attack + 1
if claimid not in firstbroken.keys():
firstbroken[claimid] = bound
else: else:
if l.find("bounds") >= 0: if l.find("bounds") >= 0:
boundokay = boundokay + 1 boundokay = boundokay + 1
@ -51,10 +61,18 @@ def timed(file):
def all(): def all():
for i in range(1,8): for i in range(1,8):
analyze("boundruns%i.txt" % (i)) analyze("boundruns%i.txt" % (i),i)
for i in range(1,8): for i in range(1,8):
timed("boundtime%i.txt" % (i)) timed("boundtime%i.txt" % (i))
for i in range(1,8):
l = []
for k in firstbroken.keys():
if firstbroken[k] == i:
l.append(k)
print "Attack with %i runs:" % i
print l
all() all()