From 58417e341fdc8c08e1a5fe57031612b77b553f90 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 15 Apr 2017 17:56:37 +0200 Subject: Add interleaved test --- bhash/bhash_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'bhash/bhash_test.go') 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) + } +} -- cgit v1.2.3