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

npm module should be republished #1

Closed segmond closed 6 years ago

segmond commented 6 years ago

The code in js-shamir-tss-gf256/code/index.nodejs.jsy doesn't match what's installed from npm. It fails as a module.
"WEBPACK_IMPORTED_MODULE_28_shamir_tss_gf256.generateShares_64 is not a function"

// github

export function generateShares_b64(secret, thresholdShares, totalShares) :: return new ShamirSecretShare().generate_b64(secret, thresholdShares, totalShares) export function generatorShares_b64(secret, thresholdShares, totalShares) :: return new ShamirSecretShare().generator_b64(secret, thresholdShares, totalShares) export function unlockShares_b64(shares_of_secret, valueIfUnderThreshold) :: return new ShamirSecretShare().unlock_b64(shares_of_secret, valueIfUnderThreshold)

// npm in shamir-tss-gf256.dbg.js

function generateShares_b64(secret, thresholdShares, totalShares) { return new ShamirSecretShare().generateShares_b64(secret, thresholdShares, totalShares)} function generatorShares_b64(secret, thresholdShares, totalShares) { return new ShamirSecretShare().generatorShares_b64(secret, thresholdShares, totalShares)}

shanewholloway commented 6 years ago

Thanks for the report! It's great to know someone's using it.

Fixed in 075f2a603e03f2e42bcc41d3fcac7856f890507c and published to npm as v0.4.2

shanewholloway commented 6 years ago

Refactored NodeJS and Web platform handling in v0.5.0 to be DRY and avoid this problem in the future.