viff

changeset 1035:f7d1f7cd3dda

Enable faking of Shamir secret sharing.
author Martin Geisler <mg@daimi.au.dk>
date Sun, 30 Nov 2008 23:13:26 +0100
parents 1a9cfb730bc1
children d47b8da68a23
files viff/shamir.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/viff/shamir.py	Sun Nov 30 23:13:12 2008 +0100
     1.2 +++ b/viff/shamir.py	Sun Nov 30 23:13:26 2008 +0100
     1.3 @@ -24,9 +24,10 @@
     1.4  
     1.5  
     1.6  import operator
     1.7 -from viff.util import rand
     1.8 +from viff.util import rand, fake
     1.9  
    1.10  
    1.11 +@fake(lambda s, t, n: [(s.field(i+1), s) for i in range(n)])
    1.12  def share(secret, threshold, num_players):
    1.13      """Shamir share secret.
    1.14  
    1.15 @@ -92,6 +93,7 @@
    1.16  _recombination_vectors = {}
    1.17  
    1.18  
    1.19 +@fake(lambda s, x=0: s[0][1])
    1.20  def recombine(shares, x_recomb=0):
    1.21      """Recombines list of ``(xi, yi)`` pairs.
    1.22