aboutsummaryrefslogtreecommitdiff
path: root/bhash
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-04-15 17:56:37 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-04-15 17:56:37 +0200
commit58417e341fdc8c08e1a5fe57031612b77b553f90 (patch)
treec6e4ffa804691f1db0057e82be05b5c031f8cf8c /bhash
parente84e7dee9566b3fc5f218f259c9ba19b5d35744c (diff)
Add interleaved test
Diffstat (limited to 'bhash')
-rw-r--r--bhash/bhash_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/bhash/bhash_test.go b/bhash/bhash_test.go
index 492511f..191d9d0 100644
--- a/bhash/bhash_test.go
+++ b/bhash/bhash_test.go
@@ -32,3 +32,21 @@ func TestPbkdf(t *testing.T) {
t.Errorf("got %x, want %x", res, golden)
}
}
+
+func TestPbkdfLong(t *testing.T) {
+ golden := []byte{
+ 0xbf, 0x3c, 0x96, 0xcb, 0xd3, 0x7e, 0x86, 0xfe,
+ 0x0f, 0xe9, 0x27, 0x2c, 0xda, 0x0d, 0x09, 0xe1,
+ 0x45, 0x18, 0x52, 0x78, 0x3f, 0x0e, 0xa1, 0xc0,
+ 0x6b, 0x82, 0x4c, 0xcf, 0xb0, 0x58, 0xcd, 0x63,
+ 0xbb, 0xc5, 0xbd, 0x88, 0x74, 0x21, 0x14, 0x2f,
+ 0x83, 0x1f, 0x59, 0xf2, 0x66, 0x05, 0xbc, 0xaa,
+ 0x21, 0x85, 0x32, 0x9d, 0x6f, 0xc3, 0x1a, 0x5c,
+ 0x18, 0x66, 0xb8, 0xa9, 0x84, 0xd2, 0x53, 0xca,
+ }
+ zero := make([]byte, 32)
+ res := Pbkdf(zero, zero, 42, 64)
+ if !bytes.Equal(res, golden) {
+ t.Errorf("got %x, want %x", res, golden)
+ }
+}