From 725292dcaa215cbd02279f665ed109a26a223d93 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Fri, 13 Oct 2017 15:32:43 +0200 Subject: [PATCH 1/1] secret.html --- src/secret.html | 55 ++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/src/secret.html b/src/secret.html index 324cf45..39bb322 100644 --- a/src/secret.html +++ b/src/secret.html @@ -62,19 +62,13 @@ function rand256(){ /* Split number into the shares */ function split(number, number_of_shares, needed) { - var coef = [number] + var coef = [number]; // first coefficient always equals the number itself. var shares = []; - - for(var coef_index = 1; coef_index < needed; coef_index++){ - coef[coef_index] = rand256(); - } + for(var coef_index = 1; coef_index < needed; coef_index++) coef[coef_index] = rand256(); for(var share_number = 1; share_number <= number_of_shares; share_number++) { var sum = 0; - for (var coef_index =0; coef_index