changeset 1325:613aa672ba5e

shamir: Optimized by using reflected argument operators.
author Marcel Keller <mkeller@cs.au.dk>
date Thu, 22 Oct 2009 19:38:31 +0200
parents 382f0eb42dca
children f933bd327750
files viff/shamir.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/viff/shamir.py	Thu Oct 22 19:38:16 2009 +0200
+++ b/viff/shamir.py	Thu Oct 22 19:38:31 2009 +0200
@@ -79,7 +79,7 @@
         cur_share = coef[threshold]
         # Go backwards from threshold-1 down to 0
         for j in range(threshold-1, -1, -1):
-            cur_share = coef[j] + cur_point * cur_share
+            cur_share = coef[j] + cur_share * cur_point
 
         shares.append((cur_point, cur_share))