-
Notifications
You must be signed in to change notification settings - Fork 1
/
data_for_test.go
61 lines (55 loc) · 1.87 KB
/
data_for_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
54
55
56
57
58
59
60
61
package gotrx
import (
"time"
)
func generateSitaClientProfile(longTerm *Keypair, forgingKey *Keypair) *ClientProfile {
sita := &ClientProfile{}
sita.InstanceTag = 0x1245ABCD
sita.PublicKey = longTerm.Pub
sita.ForgingKey = forgingKey.Pub
sita.Versions = []byte{'4'}
sita.Expiration = time.Date(2028, 11, 5, 13, 46, 00, 13, time.UTC)
sita.DsaKey = nil
sita.TransitionalSignature = nil
sita.Sig = &EddsaSignature{s: [114]byte{
0x54, 0x5a, 0x43, 0x79, 0xb1, 0xbe, 0x27,
0xa0, 0x7d, 0xe2, 0x81, 0xbe, 0x20, 0x93,
0x23, 0x30, 0xeb, 0x1b, 0x64, 0xbc, 0x05,
0xe0, 0x70, 0x5b, 0x0d, 0x84, 0x1f, 0x06,
0xbd, 0x5c, 0x48, 0x3d, 0xee, 0x06, 0x36,
0xc5, 0x24, 0x1f, 0x31, 0x84, 0xcb, 0xd5,
0xf6, 0x11, 0x2c, 0xdd, 0x7b, 0xc8, 0x00,
0x33, 0x11, 0x08, 0x0c, 0xb2, 0xd7, 0xa7,
0x00, 0xba, 0x16, 0xe7, 0x00, 0x4d, 0x9e,
0x32, 0x09, 0x0b, 0x52, 0x88, 0xa4, 0x1f,
0xa5, 0xcc, 0x2c, 0x2d, 0x28, 0x4f, 0xbc,
0x82, 0xa0, 0x2f, 0x15, 0xcc, 0x16, 0xcd,
0xc5, 0xd2, 0x5d, 0xc4, 0xa5, 0xc2, 0xd3,
0xa9, 0xa9, 0x92, 0xac, 0x58, 0x5e, 0xd5,
0x67, 0xde, 0x8b, 0x86, 0x7c, 0x9b, 0x06,
0x8d, 0x69, 0xee, 0x2b, 0x7b, 0x03, 0xa5,
0x2d, 0x0,
}}
return sita
}
func generateSitaIPoint() *Keypair {
return DeriveKeypair([SymKeyLength]byte{0x42, 0x11, 0xCC, 0x22, 0xDD, 0x11, 0xFF})
}
type testData struct {
instanceTag uint32
longTerm *Keypair
forgingKey *Keypair
clientProfile *ClientProfile
i *Keypair
}
func generateSitaTestData() *testData {
t := &testData{}
t.instanceTag = 0x1245ABCD
t.longTerm = DeriveKeypair([SymKeyLength]byte{0x42, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55})
t.forgingKey = DeriveKeypair([SymKeyLength]byte{0x55, 0x00, 0x00, 0x22, 0x33, 0x00, 0x00, 0x44})
t.forgingKey.Pub.keyType = ForgingKey
t.clientProfile = generateSitaClientProfile(t.longTerm, t.forgingKey)
t.i = generateSitaIPoint()
return t
}
var sita = generateSitaTestData()