Skip to content

Commit

Permalink
Add SHA-512 test vector
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg committed Jan 16, 2022
1 parent 0606693 commit 5295052
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
21 changes: 21 additions & 0 deletions testdata/good/sha-512-ascii.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"label": "SHA-512 example",
"digest": "SHA-512",
"user": "user",
"pass": "pencil",
"authID": "",
"skipSASLprep": false,
"salt64": "W22ZaJ0SNY7soEsUEjb6gQ==",
"iters": 10000,
"clientNonce": "/uAp+YhRXyuq+1zS3YWsUsZHpxLfGkcQ",
"serverNonce": "4FHzBxBhPzykjGStpoxdfs4Nyp1mtC9B",
"valid": true,
"steps" : [
"n,,n=user,r=/uAp+YhRXyuq+1zS3YWsUsZHpxLfGkcQ",
"r=/uAp+YhRXyuq+1zS3YWsUsZHpxLfGkcQ4FHzBxBhPzykjGStpoxdfs4Nyp1mtC9B,s=W22ZaJ0SNY7soEsUEjb6gQ==,i=10000",
"c=biws,r=/uAp+YhRXyuq+1zS3YWsUsZHpxLfGkcQ4FHzBxBhPzykjGStpoxdfs4Nyp1mtC9B,p=E2tqtuwJz5ShFuck1/KeqZKCmGZe/Lxjyr6fTZio21wZtlpgyeYLNxxQXrLuK/FfMSCanyDRmI1q5KL1Tj54nQ==",
"v=qKOkLNGdt0VrlVkoL3kXjhWmI4SjEfqw8ogXgikzbPOMh6gloo8Mrboq/q3cz0/7hIvcQ1N9VL4m7iiSTTyolQ==",
""
]
}

2 changes: 2 additions & 0 deletions testdata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ func getHGF(s string) (HashGeneratorFcn, error) {
return SHA1, nil
case "SHA-256":
return SHA256, nil
case "SHA-512":
return SHA512, nil
default:
panic(fmt.Sprintf("Unknown hash function '%s'", s))
}
Expand Down

0 comments on commit 5295052

Please sign in to comment.