viff

changeset 1399:2cbe81569dd0

Orlandi: Use tripple_3a.
author Thomas P Jakobsen <tpj@cs.au.dk>
date Fri, 27 Nov 2009 16:13:56 +0100
parents 44ac3a04f413
children 3a225dcdaccb
files viff/orlandi.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/viff/orlandi.py	Fri Nov 27 11:21:50 2009 +0100
     1.2 +++ b/viff/orlandi.py	Fri Nov 27 16:13:56 2009 +0100
     1.3 @@ -926,8 +926,12 @@
     1.4                        broadcast ``C_i = Com_ck(c_i, t_i)``
     1.5              """
     1.6              # c_i = SUM_j Dec_sk_i(gamma_ij) - SUM_j d_ji mod p.
     1.7 -            ls = decrypt_gammas(gammas)
     1.8 -            ci = sum(ls, field(0)) - sum(dijs, field(0))
     1.9 +            dls = []
    1.10 +            for dij in dijs:
    1.11 +                dls.append(dij.value)
    1.12 +
    1.13 +            ls = [list(x) for x in zip(gammas, dls)]
    1.14 +            ci = field(tripple_3a(ls, self.players[self.id].seckey))
    1.15              # (b) pick random t_i in (Z_p)^2.
    1.16              t1 = random_number(field.modulus)
    1.17              t2 = random_number(field.modulus)