changeset 1088:3da9bd2661a3

Fixed a bug occurring in AES encryption when benchmarking is disabled.
author Marcel Keller <mkeller@cs.au.dk>
date Fri, 23 Jan 2009 14:16:53 +0100
parents 2e3f751f0667
children 992c7eee2b3f
files viff/aes.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/viff/aes.py	Thu Jan 22 20:56:48 2009 +0100
+++ b/viff/aes.py	Fri Jan 23 14:16:53 2009 +0100
@@ -247,6 +247,8 @@
         Cleartext and key should be either a string or a list of bytes 
         (possibly shared as elements of GF256)."""
 
+        start = time.time()
+
         assert len(cleartext) == 4 * self.n_b, "Wrong length of cleartext."
         assert len(key) == 4 * self.n_k, "Wrong length of key."
 
@@ -257,7 +259,6 @@
         key = [key[4*i:4*i+4] for i in xrange(self.n_k)]
 
         if (benchmark):
-            start = time.time()
             global preparation, communication
             preparation = 0
             communication = 0