ilap / slip39-js

The javascript implementation of the SLIP39 for Shamir's Secret-Sharing for Mnemonic Codes.
MIT License
69 stars 27 forks source link

Switched key and value in forEach-callback? #18

Closed littleant closed 4 years ago

littleant commented 4 years ago

I don't know if this is intentional, but the following line seems to be wrong: https://github.com/ilap/slip39-js/blob/4d4675c2c9e4cf52ba55bac233ca014086ed5840/src/slip39_helper.js#L285

forEach((k, v) => ...) should be forEach((v, k) => ...). Below this line the share-value k is compared with the index x.

I currently don't understand the interpolate-function fully, but this doesn't look right to me. A share is a binary blob, that is compared to an index, which is an integer...