-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkdf_test.go
53 lines (44 loc) · 1.32 KB
/
kdf_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package gotrax
import . "gopkg.in/check.v1"
func (s *GotraxSuite) Test_KdfPrekeyServer_generatesCorrectValues(c *C) {
v := KdfPrekeyServer(usageBraceKey, 3, []byte("one"), []byte("two"))
c.Assert(v, DeepEquals, []byte{
0xce, 0x5b, 0x44,
})
v2 := KdfPrekeyServer(usageFingerprint, 3, []byte("one"), []byte("two"))
c.Assert(v2, DeepEquals, []byte{
0xc8, 0x05, 0x30,
})
}
func (s *GotraxSuite) Test_KdfxPrekeyServer_generatesCorrectValues(c *C) {
v := make([]byte, 3)
KdfxPrekeyServer(usageBraceKey, v, []byte("one"), []byte("two"))
c.Assert(v, DeepEquals, []byte{
0xce, 0x5b, 0x44,
})
KdfxPrekeyServer(usageFingerprint, v, []byte("one"), []byte("two"))
c.Assert(v, DeepEquals, []byte{
0xc8, 0x05, 0x30,
})
}
func (s *GotraxSuite) Test_Kdf_generatesCorrectValues(c *C) {
v := Kdf(usageBraceKey, 3, []byte("one"), []byte("two"))
c.Assert(v, DeepEquals, []byte{
0x7e, 0xa6, 0x9e,
})
v2 := Kdf(usageFingerprint, 3, []byte("one"), []byte("two"))
c.Assert(v2, DeepEquals, []byte{
0x89, 0x6b, 0x14,
})
}
func (s *GotraxSuite) Test_Kdfx_generatesCorrectValues(c *C) {
v := make([]byte, 3)
Kdfx(usageBraceKey, v, []byte("one"), []byte("two"))
c.Assert(v, DeepEquals, []byte{
0x7e, 0xa6, 0x9e,
})
Kdfx(usageFingerprint, v, []byte("one"), []byte("two"))
c.Assert(v, DeepEquals, []byte{
0x89, 0x6b, 0x14,
})
}