-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_vectors.h
191 lines (178 loc) · 10.2 KB
/
test_vectors.h
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#ifndef TEST_VECTORS_H
#define TEST_VECTORS_H
#include "iota/iota_types.h"
#include "api.h"
#define MAX_ADDRESS_INDEX 4
typedef struct TEST_VECTOR {
char seed[NUM_HASH_TRYTES + 1];
char addresses[MAX_SECURITY_LEVEL + 1][MAX_ADDRESS_INDEX + 1]
[NUM_HASH_TRYTES + NUM_CHECKSUM_TRYTES + 1];
TX_INPUT bundle[8];
char bundle_hash[81];
char signature[2][4374];
} TEST_VECTOR;
static const TEST_VECTOR PETER_VECTOR = {
// for purely coincidental reasons this seed was intialy used in the
// development
"PETERPETERPETERPETERPETERPETERPETERPETERPETERPETERPETERPETERPETERPETERPETE"
"RPETERR",
{{/* ignore index 0 as there is no security level 0 */},
{"WLRSPFNMBJRWS9DFXCGIROJCZCPJQG9PMOO9CUZNQXTLLQAYXGXT9LECGEQ9MQIWIBGQREFH"
"ULPOETHNZJINTXSWKW",
"UMDTJXHIFVYVCHXKZNMQWMDHNLVQNMJMRULXUFRLNFVVUMKYZOAETVQOWSDUAKTXVNDSVAJC"
"ASTRQNV9DNLXHHYHWA",
"LHWIEGUADQXNMRKQSBDJOAFM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