bnb-chain / tss-lib

Threshold Signature Scheme, for ECDSA and EDDSA
MIT License
790 stars 271 forks source link

feldman_vss's reconstruct function can not recover the original secret #234

Open asdfsx opened 1 year ago

asdfsx commented 1 year ago

I'm trying to use Reconstruct function to recover some data split by vss.Create. So I tried to test the function in feldman_vss_test.go I add following code into TestReconstruct to display the secret recoverd from the Shares.

fmt.Printf("original secret %v\n", secret.Bytes())
fmt.Printf("secret1 %v\n", secret1.Bytes())
fmt.Printf("secret3 %v\n", secret3.Bytes())
fmt.Printf("secret4 %v\n", secret4.Bytes())

After execute go test, I found some of them doesn't equal to the original one.

...
original secret [145 25 204 52 243 255 144 58 253 167 232 82 77 121 80 10 213 187 211 9 77 113 106 12 195 182 225 72 188 42 45 119]
secret1 [145 25 204 52 243 255 144 58 253 167 232 82 77 121 80 10 213 187 211 9 77 113 106 12 195 182 225 72 188 42 45 119]
secret3 [189 189 68 13 11 90 48 236 70 94 83 105 205 98 197 248 203 158 245 153 37 168 186 42 145 245 189 157 128 18 122 64]
secret4 [145 25 204 52 243 255 144 58 253 167 232 82 77 121 80 10 213 187 211 9 77 113 106 12 195 182 225 72 188 42 45 119]
...

I think all secret should be same, but secret3 is different from others. Is this correct?

@lukasz-zimnoch @omershlo @Shadowfiend @PlamenHristov @yycen