viff

changeset 1454:5a762613a0fb

BeDOZa: Improved error reporting on invalid commitment.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Tue, 06 Jul 2010 10:52:50 +0200
parents 9e90b4355ef7
children 682f4b1d5f91
files viff/bedoza.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/viff/bedoza.py	Tue Jul 06 10:52:44 2010 +0200
     1.2 +++ b/viff/bedoza.py	Tue Jul 06 10:52:50 2010 +0200
     1.3 @@ -207,9 +207,9 @@
     1.4                  mi = shares_codes[n + inx]
     1.5                  beta = keys[inx]
     1.6                  x += xi
     1.7 -                isOK = isOK and mi == self.MAC(alpha, beta, xi)
     1.8 -            if not isOK:
     1.9 -                raise BeDOZaException("Wrong commitment for value %s." % x)
    1.10 +                mi_prime = self.MAC(alpha, beta, xi)
    1.11 +                if not (isOK and mi == mi_prime):
    1.12 +                    raise BeDOZaException("Wrong commitment, expected %s, got %s = %s*%s + %s." % (mi.value, mi_prime.value, alpha.value, xi.value, beta.value))
    1.13              return x
    1.14  
    1.15          def exchange((xi, keyList, codes), receivers):