Skip to content

Commit 34a0227

Browse files
aewagnasahlpa
authored andcommitted
[fi] Add crypto_shadow_reg_access
1 parent 6c3e885 commit 34a0227

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
target:
2+
target_type: cw310
3+
fpga_bitstream: "../objs/lowrisc_systems_chip_earlgrey_cw310_0.1.bit"
4+
force_program_bitstream: False
5+
fw_bin: "../objs/sca_ujson_fpga_cw310.bin"
6+
output_len_bytes: 16
7+
target_clk_mult: 0.24
8+
target_freq: 24000000
9+
baudrate: 115200
10+
protocol: "ujson"
11+
port: "/dev/ttyACM4"
12+
fisetup:
13+
fi_gear: "husky"
14+
fi_type: "voltage_glitch"
15+
parameter_generation: "random"
16+
# Voltage glitch width in cycles.
17+
glitch_width_min: 5
18+
glitch_width_max: 150
19+
glitch_width_step: 3
20+
# Range for trigger delay in cycles.
21+
trigger_delay_min: 0
22+
trigger_delay_max: 500
23+
trigger_step: 10
24+
# Number of iterations for the parameter sweep.
25+
num_iterations: 100
26+
fiproject:
27+
# Project database type and memory threshold.
28+
project_db: "ot_fi_project"
29+
project_mem_threshold: 10000
30+
# Store FI plot.
31+
show_plot: True
32+
num_plots: 10
33+
plot_x_axis: "trigger_delay"
34+
plot_x_axis_legend: "[cycles]"
35+
plot_y_axis: "glitch_width"
36+
plot_y_axis_legend: "[cycles]"
37+
test:
38+
which_test: "crypto_shadow_reg_access"
39+
expected_result: '{"result":[101716736,0,0],"alerts":[0,0,0],"err_status":0}'
40+
# Set to true if the test should ignore alerts returned by the test. As the
41+
# alert handler on the device could sometime fire alerts that are not
42+
# related to the FI, ignoring is by default set to true. A manual analysis
43+
# still can be performed as the alerts are stored in the database.
44+
ignore_alerts: True

target/communication/fi_crypto_commands.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ def init(self) -> None:
3232
# Read back device ID from device.
3333
return self.read_response(max_tries=30)
3434

35+
def crypto_shadow_reg_access(self) -> None:
36+
""" Starts the crypto.fi.shadow_reg_access test.
37+
"""
38+
# CryptoFi command.
39+
self._ujson_crypto_cmd()
40+
# ShadowRegAccess command.
41+
time.sleep(0.01)
42+
self.target.write(json.dumps("ShadowRegAccess").encode("ascii"))
43+
3544
def crypto_aes_key(self) -> None:
3645
""" Starts the crypto.fi.aes_key test.
3746
"""

0 commit comments

Comments
 (0)