shanewholloway / js-shamir-tss-gf256

Uses Shamir's secret sharing method to allows space-effecient secret sharing (splitting) that requires a minimum threshold of shares in order to unlock the orignal secret.
https://shanewholloway.github.io/js-shamir-tss-gf256/
ISC License
9 stars 0 forks source link

Expected the total count to be greater than the threshold count #2

Closed dovancao closed 5 years ago

dovancao commented 5 years ago

Hi there, I'm new on javascipt. when I find some Shamir's Secret Sharing. I found your library and used it. But I got this issue. Can you help me, please? Thank you so much

As my image:

a0aab8f9634a00f86a4f43d08e465144

shanewholloway commented 5 years ago

Are you using v0.5.0?

What does example.js output for you?

I also published a tiny GitHub page so you can play with this module in your browser. Putting the following in the console does the right thing for me:

let secret = new Uint8Array([2, 1, 3, 2, 1, 3, 2, 1, 3])

let shares = shamir_tss.generateShares_b64(secret, 3, 10)
dovancao commented 5 years ago

Thank Shane. I just wondering that if my input is "interger" or "hex" string or something else. It must be converted to Uint8Array, Right?

dovancao commented 5 years ago

Thank you so much. I found my problem. Because my totalshare and threshold share is string

shanewholloway commented 5 years ago

Yes, the Galois field operates on an array of Uint8 values. Happy to help!