Open java-crypto opened 3 years ago
You probably exceed the memory limitations of the OS. I believe the sensitive parameter uses 1Gb of memory, not sure where Android likes that. Try a more moderate parameter set.
@kozw: Thanks for your comment. As I'm writing "cross platform cryptography" routines, I've checked the lower parameter sets against Java etc. and they are working as expected with equal results. The "sensitive" has of course the most resource expectations, but as the library is build for Android OS there should be (minimum) a warning or a "stopper" to avoid those errors.
I'm using Flutter_Sodium version 0.2.0 and tried to generate an Argon2id13 password hash using the sensitive parameter set.
My system parameter were:
This is the code I used to generate the hash (the full code follows at the end):
I'm using the constants Sodium.cryptoPwhashOpslimitSensitive and Sodium.cryptoPwhashMemlimitSensitive for opsLimit and memLimit.
The code fails with an Exception caught by gesture: SodiumException crypto_pwhash failed with -1 (full stack see below:):
full code (it's a simple console app, just press "run the code"):