diff options
Diffstat (limited to 'tests/scrypt.go')
-rw-r--r-- | tests/scrypt.go | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/scrypt.go b/tests/scrypt.go index f499f84..710ea82 100644 --- a/tests/scrypt.go +++ b/tests/scrypt.go @@ -217,10 +217,15 @@ func test_Hash() { salt, err := Salt() g.TErrorIf(err) - hash1, err := Hash(password, salt) + input := HashInput{ + Password: password, + Salt: salt, + } + + hash1, err := Hash(input) g.TErrorIf(err) - hash2, err := Hash(password, salt) + hash2, err := Hash(input) g.TErrorIf(err) g.TAssertEqual(hash1, hash2) @@ -231,13 +236,22 @@ func test_Check() { g.TestStart("Check()") h := func(password []byte, salt []byte) []byte { - hash, err := Hash(password, salt) + input := HashInput{ + Password: password, + Salt: salt, + } + hash, err := Hash(input) g.TErrorIf(err) return hash } chk := func(password []byte, salt []byte, hash []byte) bool { - ok, err := Check(password, salt, hash) + input := CheckInput{ + Password: password, + Salt: salt, + Hash: hash, + } + ok, err := Check(input) g.TErrorIf(err) return ok } |