Closed gurpreet- closed 6 years ago
A solution to this problem is avoiding the use of the minimum key byte value, i.e. GenericHash.KEYBYTES_MIN
.
Though, this is not an optimal solution at all as people will read the docs and then receive an error when trying to use KEYBYTES_MIN
in their programs.
GenericHash.KEYBYTES_MIN
has now been commented out.
You can still use it, but it's not recommended for the issues outlined above. Thorough testing is recommended if you really want to use KEYBYTES_MIN
in generic hash functions.
For some reason, when using functions such as
cryptoGenericHashUpdate
andcryptoGenericHashFinal
the tests irregularly fail. I say irregularly because they fail 1/10 times on my local Mac environment and all the time on Linux (through SemaphoreCI).Oddly, generic hashing works if I use key sizes
KEYBYTES
(which is equivalent to 32) upwards but fails forKEYBYTES_MIN
.Things I've tried:
GenericHash.State
to justbyte[]
. It used to be the case that Lazysodium was using a custom class to handle state, but after reading this issue, I changed all the generic hash stream functions to acceptbyte[]
instead.cryptoGenericHashUpdate
to go through less functions which fixed generic hashing on linux for key sizesKEYBYTES
upwards.