projects
/
shamirs_secret_web_implementation.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9ec0b26
)
checking wikipedia example
author
Stephan Richter
<github@keawe.de>
Tue, 19 Sep 2017 08:20:22 +0000
(10:20 +0200)
committer
Stephan Richter
<github@keawe.de>
Tue, 19 Sep 2017 08:20:22 +0000
(10:20 +0200)
src/test.html
patch
|
blob
|
history
diff --git
a/src/test.html
b/src/test.html
index ea7a7a632e8a66f7492530c6916c79859f2633c2..acbd9ecf938e8b071bd8b3fe2fa0107a73bcbc36 100644
(file)
--- a/
src/test.html
+++ b/
src/test.html
@@
-2,7
+2,7
@@
<head></head>
<body>
<script type="text/javascript">
<head></head>
<body>
<script type="text/javascript">
-var prime =
25
7;
+var prime =
123
7;
/* Split number into the shares */
function split(number, available, needed) {
/* Split number into the shares */
function split(number, available, needed) {
@@
-54,9
+54,9
@@
function join(shares) {
return accum;
}
return accum;
}
-var sh = split(12
9, 7, 6
) /* split the secret value 129 into 6 components - at least 3 of which will be needed to figure out the secret value */
+var sh = split(12
34, 6, 3
) /* split the secret value 129 into 6 components - at least 3 of which will be needed to figure out the secret value */
for (var i=0; i<sh.length; i++) alert(sh[i]);
for (var i=0; i<sh.length; i++) alert(sh[i]);
-var newshares = [sh[1], sh[3], sh[4]
, sh[5], sh[2], sh[0],sh[6]
]; /* pick any selection of 3 shared keys from sh */
+var newshares = [sh[1], sh[3], sh[4]]; /* pick any selection of 3 shared keys from sh */
alert(join(newshares));
alert(join(newshares));