I'm trying to import and use scrypt, but am having issues when trying to run an example based on the test suite:
import nimcrypto / [scrypt]
func myscrypt[T, M](password: openArray[T], salt: openArray[M],
N, r, p, keyLen: static[int]): array[keyLen, byte] =
let (xyvLen, bLen) = scryptCalc(N, r, p)
var xyv = newSeq[uint32](xyvLen)
var b = newSeq[byte](bLen)
discard scrypt(password, salt, N, r, p, xyv, b, result)
discard myscrypt(password = "", salt = "", N = 16, r = 1, p = 1, keyLen = 64)
nim c -r main.nim
Hint: used config file '/home/deeuu/.choosenim/toolchains/nim-1.4.2/config/nim.cfg' [Conf]
Hint: used config file '/home/deeuu/.choosenim/toolchains/nim-1.4.2/config/config.nims' [Conf]
..............
/home/deeuu/git/nimcrypto/main.nim(10, 17) template/generic instantiation of `myscrypt` from here
/home/deeuu/git/nimcrypto/main.nim(8, 17) template/generic instantiation of `scrypt` from here
/home/deeuu/git/nimcrypto/nimcrypto/hmac.nim(89, 25) Error: undeclared field: 'hmacSizeBlock'
It looks like I have to import hmac to get around it, i.e.
Hi,
I'm trying to import and use
scrypt
, but am having issues when trying to run an example based on the test suite:It looks like I have to import
hmac
to get around it, i.e.Any help is much appreciated!