From 3ba082f25a655334f0fb25c9fbaf688fe7a13186 Mon Sep 17 00:00:00 2001 From: Dwayne Litzenberger Date: Sat, 16 Feb 2013 09:37:46 -0800 Subject: pct-speedtest.py: Python 3 compatibility --- pct-speedtest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pct-speedtest.py b/pct-speedtest.py index 9763f09..d2216b9 100644 --- a/pct-speedtest.py +++ b/pct-speedtest.py @@ -59,7 +59,7 @@ class Benchmark: bytes = bytes_per_block * blocks data = self.random_data(bytes) retval = [] - for i in xrange(blocks): + for i in range(blocks): p = i * bytes_per_block retval.append(data[p:p+bytes_per_block]) return retval @@ -172,9 +172,9 @@ class Benchmark: def run(self): pubkey_specs = [ - ("RSA(1024)", RSA, 1024/8), - ("RSA(2048)", RSA, 2048/8), - ("RSA(4096)", RSA, 4096/8), + ("RSA(1024)", RSA, int(1024/8)), + ("RSA(2048)", RSA, int(2048/8)), + ("RSA(4096)", RSA, int(4096/8)), ] block_specs = [ ("DES", DES, 8), -- cgit v1.2.1