changeset 1087:2e3f751f0667

Tiny optimization in invert_by_masking().
author Marcel Keller <mkeller@cs.au.dk>
date Thu, 22 Jan 2009 20:56:48 +0100
parents e954b0a9c939
children 3da9bd2661a3
files viff/aes.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/viff/aes.py	Thu Jan 22 19:15:41 2009 +0100
+++ b/viff/aes.py	Thu Jan 22 20:56:48 2009 +0100
@@ -96,7 +96,8 @@
             bits = bit_decompose(byte)
 
             for j in range(len(bits)):
-                bits[j] = 1 - bits[j]
+                bits[j].addCallback(lambda x: GF256(1) - x)
+#                bits[j] = 1 - bits[j]
 
             while(len(bits) > 1):
                 bits.append(bits.pop() * bits.pop())