Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/functions/shamir_secret_sharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ module.exports = function (S) {


S.__split_secret = (threshold, total, secret, indexBits=8) => {
if (threshold < 2) throw new Error("Minimum 2 shares required");
if (threshold > 255) throw new Error("threshold limit 255");
if (total > 255) throw new Error("total limit 255");
let index_mask = 2**indexBits - 1;
Expand Down Expand Up @@ -167,4 +168,4 @@ module.exports = function (S) {
};

S.__precompute_GF256_expLog(S);
};
};
7 changes: 5 additions & 2 deletions test/jsbtc.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading