|
@@ -22,6 +22,16 @@ func TestBasic(t *testing.T) {
|
22
|
22
|
}
|
23
|
23
|
}
|
24
|
24
|
|
|
25
|
+func TestVector(t *testing.T) {
|
|
26
|
+ // sanity check for persisted hashes
|
|
27
|
+ if CompareHashAndPassword(
|
|
28
|
+ []byte("$2a$12$sJokyLJ5px3Nb51DEDhsQ.wh8nfwEYuMbVYrpqO5v9Ylyj0YyVWj."),
|
|
29
|
+ []byte("this is my passphrase"),
|
|
30
|
+ ) != nil {
|
|
31
|
+ t.Errorf("hash comparison failed unexpectedly")
|
|
32
|
+ }
|
|
33
|
+}
|
|
34
|
+
|
25
|
35
|
func TestLongPassphrases(t *testing.T) {
|
26
|
36
|
longPassphrase := make([]byte, 168)
|
27
|
37
|
for i := range longPassphrase {
|