-
Notifications
You must be signed in to change notification settings - Fork 0
/
log
337 lines (303 loc) · 10.4 KB
/
log
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
11/20/2019 02:26
gli@ubuntu:~/picorv32/brlwesoc$ make hx8ksim
iverilog -s testbench -o hx8kdemo_tb.vvp hx8kdemo_tb.v hx8kdemo.v spimemio.v simpleuart.v picosoc.v ../picorv32.v spiflash.v `yosys-config --datdir/ice40/cells_sim.v`
vvp -N hx8kdemo_tb.vvp +firmware=hx8kdemo_fw.hex
VCD info: dumpfile testbench.vcd opened for output.
Booting..
Polynomial initialization step:
test1 =
1e149650
test2 =
01000101
Math-operation subfunctions:
test1 + test2 =
1f149751
test1 - test2 =
1d14954f
test1 * test2 =
742e6482
gli@ubuntu:~/picorv32/brlwesoc$ make hx8ksim
riscv32-unknown-elf-gcc -DHX8KDEMO -march=rv32imc -Wl,-Bstatic,-T,hx8kdemo_sections.lds,--strip-debug -ffreestanding -nostdlib -o hx8kdemo_fw.elf start.s firmware.c
In file included from firmware.c:27:
brlwe.c: In function 'BRLWE_Key_Gen':
brlwe.c:65:25: warning: initializer-string for array of chars is too long
uint8_t _r1[BRLWE_N] = "(uint8_t) 1, (uint8_t) 0, (uint8_t) 1 , (uint8_t) 0 ";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
brlwe.c:66:25: warning: initializer-string for array of chars is too long
uint8_t _r2[BRLWE_N] = "(uint8_t) 1, (uint8_t) 0, (uint8_t) 0 , (uint8_t) 1 ";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
brlwe.c:68:17: warning: passing argument 1 of 'BRLWE_init_hex' from incompatible pointer type [-Wincompatible-pointer-types]
BRLWE_init_hex(&r2, _r2, 0);
^~~
In file included from firmware.c:27:
brlwe.c:42:52: note: expected 'struct BRLWE_Ring_polynomials *' but argument is of type 'struct BRLWE_Ring_polynomials **'
void BRLWE_init_hex(struct BRLWE_Ring_polynomials* poly, uint8_t* str, int rev) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from firmware.c:27:
brlwe.c: In function 'BRLWE_Encry':
brlwe.c:84:25: warning: initializer-string for array of chars is too long
uint8_t _e1[BRLWE_N] = "(uint8_t) 1, (uint8_t) 1, (uint8_t) 1 , (uint8_t) 0 ";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
brlwe.c:85:25: warning: initializer-string for array of chars is too long
uint8_t _e2[BRLWE_N] = "(uint8_t) 0, (uint8_t) 1, (uint8_t) 1 , (uint8_t) 1 ";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
brlwe.c:86:25: warning: initializer-string for array of chars is too long
uint8_t _e3[BRLWE_N] = "(uint8_t) 1, (uint8_t) 0, (uint8_t) 1 , (uint8_t) 0 ";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
riscv32-unknown-elf-objcopy -O verilog hx8kdemo_fw.elf hx8kdemo_fw.hex
vvp -N hx8kdemo_tb.vvp +firmware=hx8kdemo_fw.hex
VCD info: dumpfile testbench.vcd opened for output.
Booting..
Polynomial initialization step:
test1 =
1e149650
test2 =
01000101
Math-operation subfunctions:
test1 + test2 =
1f149751
test1 - test2 =
1d14954f
test1 * test2 =
742e6482
Key Generation:
gli@ubuntu:~/picorv32/brlwesoc$ make hx8ksim
iverilog -s testbench -o hx8kdemo_tb.vvp hx8kdemo_tb.v hx8kdemo.v spimemio.v simpleuart.v picosoc.v ../picorv32.v spiflash.v `yosys-config --datdir/ice40/cells_sim.v`
riscv32-unknown-elf-gcc -DHX8KDEMO -march=rv32imc -Wl,-Bstatic,-T,hx8kdemo_sections.lds,--strip-debug -ffreestanding -nostdlib -o hx8kdemo_fw.elf start.s firmware.c
In file included from firmware.c:27:
brlwe.c: In function 'BRLWE_Key_Gen':
brlwe.c:65:25: warning: initializer-string for array of chars is too long
uint8_t _r1[BRLWE_N] = "(uint8_t) 1, (uint8_t) 0, (uint8_t) 1 , (uint8_t) 0 ";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
brlwe.c:66:25: warning: initializer-string for array of chars is too long
uint8_t _r2[BRLWE_N] = "(uint8_t) 1, (uint8_t) 0, (uint8_t) 0 , (uint8_t) 1 ";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
brlwe.c:68:17: warning: passing argument 1 of 'BRLWE_init_hex' from incompatible pointer type [-Wincompatible-pointer-types]
BRLWE_init_hex(&r2, _r2, 0);
^~~
In file included from firmware.c:27:
brlwe.c:42:52: note: expected 'struct BRLWE_Ring_polynomials *' but argument is of type 'struct BRLWE_Ring_polynomials **'
void BRLWE_init_hex(struct BRLWE_Ring_polynomials* poly, uint8_t* str, int rev) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from firmware.c:27:
brlwe.c: In function 'BRLWE_Encry':
brlwe.c:84:25: warning: initializer-string for array of chars is too long
uint8_t _e1[BRLWE_N] = "(uint8_t) 1, (uint8_t) 1, (uint8_t) 1 , (uint8_t) 0 ";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
brlwe.c:85:25: warning: initializer-string for array of chars is too long
uint8_t _e2[BRLWE_N] = "(uint8_t) 0, (uint8_t) 1, (uint8_t) 1 , (uint8_t) 1 ";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
brlwe.c:86:25: warning: initializer-string for array of chars is too long
uint8_t _e3[BRLWE_N] = "(uint8_t) 1, (uint8_t) 0, (uint8_t) 1 , (uint8_t) 0 ";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
riscv32-unknown-elf-objcopy -O verilog hx8kdemo_fw.elf hx8kdemo_fw.hex
vvp -N hx8kdemo_tb.vvp +firmware=hx8kdemo_fw.hex
VCD info: dumpfile testbench.vcd opened for output.
Booting..
Polynomial initialization step:
test1 =
1e149650
test2 =
01000101
Key Generation:
11/20/2019 3:33
gli@ubuntu:~/picorv32/brlwesoc$ make hx8ksim
riscv32-unknown-elf-gcc -DHX8KDEMO -march=rv32imc -Wl,-Bstatic,-T,hx8kdemo_sections.lds,--strip-debug -ffreestanding -nostdlib -o hx8kdemo_fw.elf start.s firmware.c
In file included from firmware.c:27:
brlwe.c: In function 'BRLWE_Key_Gen':
brlwe.c:68:17: warning: passing argument 1 of 'BRLWE_init_hex' from incompatible pointer type [-Wincompatible-pointer-types]
BRLWE_init_hex(&r2, _r2, 0);
^~~
In file included from firmware.c:27:
brlwe.c:42:52: note: expected 'struct BRLWE_Ring_polynomials *' but argument is of type 'struct BRLWE_Ring_polynomials **'
void BRLWE_init_hex(struct BRLWE_Ring_polynomials* poly, uint8_t* str, int rev) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
riscv32-unknown-elf-objcopy -O verilog hx8kdemo_fw.elf hx8kdemo_fw.hex
vvp -N hx8kdemo_tb.vvp +firmware=hx8kdemo_fw.hex -DRBINLWEENCT=1
VCD info: dumpfile testbench.vcd opened for output.
Booting..
Polynomial initialization step:
test1 =
1e149650
test2 =
01000101
Key Generation:
public key =
ddb489e8
secret key =
e0030000
Encryption:
a =
1e149650
public key =
ddb489e8
original message =
01000101
secret message =
89c4b465
75cfe51a
gli@ubuntu:~/picorv32/brlwesoc$ make hx8ksim
riscv32-unknown-elf-gcc -DHX8KDEMO -march=rv32imc -Wl,-Bstatic,-T,hx8kdemo_sections.lds,--strip-debug -ffreestanding -nostdlib -o hx8kdemo_fw.elf start.s firmware.c
In file included from firmware.c:27:
brlwe.c: In function 'BRLWE_Key_Gen':
brlwe.c:68:17: warning: passing argument 1 of 'BRLWE_init_hex' from incompatible pointer type [-Wincompatible-pointer-types]
BRLWE_init_hex(&r2, _r2, 0);
^~~
In file included from firmware.c:27:
brlwe.c:42:52: note: expected 'struct BRLWE_Ring_polynomials *' but argument is of type 'struct BRLWE_Ring_polynomials **'
void BRLWE_init_hex(struct BRLWE_Ring_polynomials* poly, uint8_t* str, int rev) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
riscv32-unknown-elf-objcopy -O verilog hx8kdemo_fw.elf hx8kdemo_fw.hex
vvp -N hx8kdemo_tb.vvp +firmware=hx8kdemo_fw.hex -DRBINLWEENCT=1
VCD info: dumpfile testbench.vcd opened for output.
Booting..
Polynomial initialization step:
test1 =
1e149650
test2 =
01000101
Key Generation:
public key =
ddb489e8
secret key =
dc030000
Encryption:
a =
1e149650
public key =
ddb489e8
original message =
01000101
secret message =
89c4b465
65cfe51a
Decryption:
a =
1e149650
secret key =
dc030000
secret message =
89c4b465
65cfe51a
original message =
01000101
decrypted message =
01000000
11/20/2019 12:15
gli@ubuntu:~/picorv32/brlwesoc$ make hx8ksim
vvp -N hx8kdemo_tb.vvp +firmware=hx8kdemo_fw.hex -DRBINLWEENCT=1
VCD info: dumpfile testbench.vcd opened for output.
Booting..
Polynomial initialization step:
test1 =
1e149650
test2 =
01000101
Key Generation:
public key =
ddb489e8
secret key =
dc030000
Encryption:
a =
1e149650
public key =
ddb489e8
original message =
01000101
secret message =
89c4b465
65cfe51a
Decryption:
a =
1e149650
secret key =
dc030000
secret message =
89c4b465
65cfe51a
original message =
01000101
decrypted message =
01000000
11/20/2019 14:16
gli@ubuntu:~/picorv32/brlwesoc$ make hx8ksim
iverilog -s testbench -o hx8kdemo_tb.vvp hx8kdemo_tb.v hx8kdemo.v spimemio.v simpleuart.v picosoc.v ../picorv32.v spiflash.v `yosys-config --datdir/ice40/cells_sim.v`
vvp -N hx8kdemo_tb.vvp +firmware=hx8kdemo_fw.hex -DRBINLWEENCT=1
VCD info: dumpfile testbench.vcd opened for output.
Booting..
Polynomial initialization step:
Key Generation:
public key =
f782bb92
secret key =
01000001
Encryption:
a =
1e149650
public key =
f782bb92
original message =
01000101
secret message =
38e3c9fb
2ce7b44d
Decryption:
a =
1e149650
secret key =
01000001
secret message =
38e3c9fb
2ce7b44d
original message =
01000101
decrypted message =
01000101
11/20/2019 16:11
gli@ubuntu:~/picorv32/brlwesoc$ make hx8kprog
riscv32-unknown-elf-gcc -DHX8KDEMO -DRBINLWEENCT=1 -march=rv32imc -Wl,-Bstatic,-T,hx8kdemo_sections.lds,--strip-debug -ffreestanding -nostdlib -o hx8kdemo_fw.elf start.s firmware.c
riscv32-unknown-elf-objcopy -O binary hx8kdemo_fw.elf hx8kdemo_fw.bin
iceprog hx8kdemo.bin
init..
cdone: high
reset..
cdone: low
flash ID: 0x20 0xBA 0x16 0x10 0x00 0x00 0x23 0x71 0x32 0x74 0x11 0x00 0x58 0x00 0x39 0x17 0x05 0x17 0x85 0xCC
file size: 135100
erase 64kB sector at 0x000000..
erase 64kB sector at 0x010000..
erase 64kB sector at 0x020000..
programming..
reading..
VERIFY OK
cdone: high
Bye.
iceprog -o 1M hx8kdemo_fw.bin
init..
cdone: high
reset..
cdone: low
flash ID: 0x20 0xBA 0x16 0x10 0x00 0x00 0x23 0x71 0x32 0x74 0x11 0x00 0x58 0x00 0x39 0x17 0x05 0x17 0x85 0xCC
file size: 9548
erase 64kB sector at 0x100000..
programming..
reading..
VERIFY OK
cdone: high
Bye.
2/7/2020 20:57
riscv32-unknown-elf-gcc -DHX8KDEMO -DRBINLWEENCT=1 -march=rv32imc -Wl,-Bstatic,-T,hx8kdemo_sections.lds,--strip-debug -ffreestanding -nostdlib -o hx8kdemo_fw.elf start.s firmware.c
riscv32-unknown-elf-objcopy -O verilog hx8kdemo_fw.elf hx8kdemo_fw.hex
vvp -N hx8kdemo_tb.vvp +firmware=hx8kdemo_fw.hex -DRBINLWEENCT=1
VCD info: dumpfile testbench.vcd opened for output.
Booting..
Polynomial initialization step:
test1 =
1e149650
test2 =
01000101
RNG generation:
random number =
0000007f
Cycle now in hex is : 0009e777