lyubo / react-native-sodium

ISC License
61 stars 46 forks source link

Implement crypto_secretbox_keygen and types #31

Closed DiogoAbu closed 4 years ago

DiogoAbu commented 4 years ago

According to the docs the crypto_secretbox_keygen is equivalent to calling randombytes_buf() but improves code clarity and can prevent misuse by ensuring that the provided key length is always be correct. Same thing for crypto_auth_keygen.

Also fix secretbox functions using box constants.

And add typescript declaration files, with proper types.

Tested on Android, but can't test on iOS.

lyubo commented 4 years ago

Well, I can merge this one after spending some time on iOS testing.