diff --git a/fault_injection/configs/pen.global_fi.crypto.shadow_reg_access.cw310.yaml b/fault_injection/configs/pen.global_fi.crypto.shadow_reg_access.cw310.yaml new file mode 100644 index 00000000..be04900d --- /dev/null +++ b/fault_injection/configs/pen.global_fi.crypto.shadow_reg_access.cw310.yaml @@ -0,0 +1,44 @@ +target: + target_type: cw310 + fpga_bitstream: "../objs/lowrisc_systems_chip_earlgrey_cw310_0.1.bit" + force_program_bitstream: False + fw_bin: "../objs/sca_ujson_fpga_cw310.bin" + output_len_bytes: 16 + target_clk_mult: 0.24 + target_freq: 24000000 + baudrate: 115200 + protocol: "ujson" + port: "/dev/ttyACM4" +fisetup: + fi_gear: "husky" + fi_type: "voltage_glitch" + parameter_generation: "random" + # Voltage glitch width in cycles. + glitch_width_min: 5 + glitch_width_max: 150 + glitch_width_step: 3 + # Range for trigger delay in cycles. + trigger_delay_min: 0 + trigger_delay_max: 500 + trigger_step: 10 + # Number of iterations for the parameter sweep. + num_iterations: 100 +fiproject: + # Project database type and memory threshold. + project_db: "ot_fi_project" + project_mem_threshold: 10000 + # Store FI plot. + show_plot: True + num_plots: 10 + plot_x_axis: "trigger_delay" + plot_x_axis_legend: "[cycles]" + plot_y_axis: "glitch_width" + plot_y_axis_legend: "[cycles]" +test: + which_test: "crypto_shadow_reg_access" + expected_result: '{"result":[101716736,0,0],"alerts":[0,0,0],"err_status":0}' + # Set to true if the test should ignore alerts returned by the test. As the + # alert handler on the device could sometime fire alerts that are not + # related to the FI, ignoring is by default set to true. A manual analysis + # still can be performed as the alerts are stored in the database. + ignore_alerts: True diff --git a/target/communication/fi_crypto_commands.py b/target/communication/fi_crypto_commands.py index 9e58f485..1c9df92f 100644 --- a/target/communication/fi_crypto_commands.py +++ b/target/communication/fi_crypto_commands.py @@ -32,6 +32,15 @@ def init(self) -> None: # Read back device ID from device. return self.read_response(max_tries=30) + def crypto_shadow_reg_access(self) -> None: + """ Starts the crypto.fi.shadow_reg_access test. + """ + # CryptoFi command. + self._ujson_crypto_cmd() + # ShadowRegAccess command. + time.sleep(0.01) + self.target.write(json.dumps("ShadowRegAccess").encode("ascii")) + def crypto_aes_key(self) -> None: """ Starts the crypto.fi.aes_key test. """