I'm having a problem of calculating the same scrypt digest between RbNaCl and Go's implementation.
Here's how I'm generating key with rbnacl:
opslimit = 2**20
memlimit = 2**24
digest_size = 32
digest = RbNaCl::PasswordHash.scrypt(
password,
salt,
opslimit,
memlimit,
digest_size
)
opslimit and memlimit parameter values have been found from documentation.
Here's my attempt to replicate same results with Go:
N := 32768
r := 8
p := 1
keyLength := 32
secretKeyBytes, _ := scrypt.Key(password, salt, N, r, p, keyLength)
Values for N, r, p and keyLength gotten from documentation.
password and salt have same values.
I'm not a cryptographer, but as far as I understand there should be same cost factor values to get the same digest? The problem here is that since both implementations take different count of parameters it's hard for me to find the correct combination too. Any ideas how to make cost factors match between these two implementations so that I could calculate same scrypt hashes between two programming languages?