viff

changeset 1253:2fc11d4132c5

Added preprocessing for masked exponentiation with active security.
author Marcel Keller <mkeller@cs.au.dk>
date Thu, 24 Sep 2009 14:13:27 +0200
parents 0f35ae3f503b
children fe84468a46ca
files apps/aes.py
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/apps/aes.py	Thu Sep 17 17:59:08 2009 +0200
     1.2 +++ b/apps/aes.py	Thu Sep 24 14:13:27 2009 +0200
     1.3 @@ -137,10 +137,20 @@
     1.4              max = 301
     1.5              js = [1 + i * 15 + j for i in range(20) for j in range(13)]
     1.6  
     1.7 -        pcs = [(2, 18, k) +  (max,) * i + (j, 1, 0)
     1.8 -               for k in range(1, options.count + 1)
     1.9 -               for i in range(10)
    1.10 -               for j in js]
    1.11 +        if options.exponentiation == 4:
    1.12 +            pcs = [(1, 2 + 130 * options.count + 141 * i + j, 1, 0)
    1.13 +                   for i in range(10 * options.count)
    1.14 +                   for j in range(140)] + \
    1.15 +                  [(2, 18, k) + (81,) * i + (2 + 4 * j, 3, l, 1, 0)
    1.16 +                   for k in range(1, options.count + 1)
    1.17 +                   for i in range(10)
    1.18 +                   for j in range(20)
    1.19 +                   for l in range(1, 7)]
    1.20 +        else:
    1.21 +            pcs = [(2, 18, k) + (max,) * i + (j, 1, 0)
    1.22 +                   for k in range(1, options.count + 1)
    1.23 +                   for i in range(10)
    1.24 +                   for j in js]
    1.25          program_desc[("generate_triples", (GF256,))] = pcs
    1.26  
    1.27      if options.exponentiation == 4: