Consensys / react-native-sssa

Shamir's secret sharing algorithm for react-native
https://consensys.github.io/web3studio-sojourn/#the-vault
Apache License 2.0
16 stars 5 forks source link

Error on Android with generateShares method #27

Open yowlu opened 5 years ago

yowlu commented 5 years ago

It works great on iOS but when running the exact same code on Android I get the following error when using generateShares method:

TypeError: undefined is not a function (evaluating '(0, _base64Js.toByteArray)(base64).reverse()')

Do you know what might be happening?

yowlu commented 5 years ago

I have been trying it more and I added a workaround for that error but now what does not work (on Android) is the combine method. Has this been tested on Android?

hadasz commented 5 years ago

This does not have support for Android yet. I'll make that more clear in the README. Feel free to put in a pull request for any work arounds you might find.

Thanks for taking the time! Feel free to reach out whenever.

yowlu commented 5 years ago

Thanks for your response!

However, I have finally used shamirs-secret-sharing for the secret sharing and react-native-crypto-js for encrypt and decrypt.

I think the secret sharing was almost working on Android by changing this line to something like

let byteArray = Object.values(toByteArray(base64)).reverse();

but then the encrypt and decrypt using the react-native-aes-crypto it also don't work as stated here so you should change the libraries you use for it.

hadasz commented 5 years ago

got it, i'll look into that - thanks