From: Stephan Richter Date: Fri, 13 Oct 2017 13:32:43 +0000 (+0200) Subject: secret.html X-Git-Url: https://fpunktk.de/gitweb/?a=commitdiff_plain;h=725292dcaa215cbd02279f665ed109a26a223d93;hp=bdb65f4e5b44533402087235cb98b30524f2dac5;p=shamirs_secret_web_implementation.git secret.html --- 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