You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I'm unsure which methods from react-native-sodium to use and how to implement them. I tried swapping in rnsodium.crypto_secretbox_easy for crypto_aead_xchacha20poly1305_ietf_encrypt, but getting an unhelpful FAILURE error, even after converting all Uint8Arrays to base64.
Any suggestions here? Is this the right approach? Can you think of what the issue might be with using crypto_secretbox_easy?
It looks like the error comes from this line in react-native-sodium:
I'm trying to create an
Item
with 1MB of binary content in React Native, and there are two methods running over 13 seconds each:CryptoManager.encrypt
etebase-js/src/Crypto.ts
Line 131 in a42c067
and
CryptoManager.calculateMac
etebase-js/src/Crypto.ts
Line 186 in a42c067
I believe it's due to the
sodium
methods being called:sodium.crypto_aead_xchacha20poly1305_ietf_encrypt
sodium.crypto_generichash
I'm attempting fix this with a PR, by detecting the React Native environment similar to how the library already detects it here:
etebase-js/src/Crypto.ts
Line 89 in a42c067
But I'm unsure which methods from
react-native-sodium
to use and how to implement them. I tried swapping inrnsodium.crypto_secretbox_easy
forcrypto_aead_xchacha20poly1305_ietf_encrypt
, but getting an unhelpfulFAILURE
error, even after converting all Uint8Arrays to base64.Any suggestions here? Is this the right approach? Can you think of what the issue might be with using
crypto_secretbox_easy
?It looks like the error comes from this line in
react-native-sodium
:https://github.com/lyubo/react-native-sodium/blob/41c8a0e785ec136f487ab85a27202919a0b2222c/ios/RCTSodium/RCTSodium.m#L138
Which points towards me not converting the data properly.
Any help is appreciated, thanks!
The text was updated successfully, but these errors were encountered: