Skip to content

Commit

Permalink
[fi] Add additional hardened check cmd handlers
Browse files Browse the repository at this point in the history
This commit adds the following FI test command handlers:
- ibex_char_hardened_check_eq_unimp
- ibex_char_hardened_check_eq_2_unimps
- ibex_char_hardened_check_eq_3_unimps

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
nasahlpa committed Jun 20, 2024
1 parent 61dab12 commit e251ad0
Showing 2 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -34,7 +34,9 @@ fiproject:
plot_y_axis: "glitch_width"
plot_y_axis_legend: "[cycles]"
test:
which_test: "ibex_char_hardened_check_eq_unimps"
which_test: "ibex_char_hardened_check_eq_unimp"
# which_test: "ibex_char_hardened_check_eq_2_unimps"
# which_test: "ibex_char_hardened_check_eq_3_unimps"
# For this test, the expected result is actually a crash of the system. On
# a successful FI attack, this could be one result:
expected_result: '{"result1":0,"result2":1,"err_status":0,"alerts":0}'
26 changes: 22 additions & 4 deletions target/communication/fi_ibex_commands.py
Original file line number Diff line number Diff line change
@@ -268,14 +268,32 @@ def ibex_address_translation(self) -> None:
time.sleep(0.01)
self.target.write(json.dumps("AddressTranslation").encode("ascii"))

def ibex_char_hardened_check_eq_unimps(self) -> None:
""" Starts the ibex.fi.char.hardened_check_eq_unimps test.
def ibex_char_hardened_check_eq_unimp(self) -> None:
""" Starts the ibex.fi.char.hardened_check_eq_unimp test.
"""
# IbexFi command.
self._ujson_ibex_fi_cmd()
# CharHardenedCheck command.
# CharHardenedCheckUnimp command.
time.sleep(0.01)
self.target.write(json.dumps("CharHardenedCheck").encode("ascii"))
self.target.write(json.dumps("CharHardenedCheckUnimp").encode("ascii"))

def ibex_char_hardened_check_eq_2_unimps(self) -> None:
""" Starts the ibex.fi.char.hardened_check_eq_2_unimps test.
"""
# IbexFi command.
self._ujson_ibex_fi_cmd()
# CharHardenedCheck2Unimps command.
time.sleep(0.01)
self.target.write(json.dumps("CharHardenedCheck2Unimps").encode("ascii"))

def ibex_char_hardened_check_eq_3_unimps(self) -> None:
""" Starts the ibex.fi.char.hardened_check_eq_3_unimps test.
"""
# IbexFi command.
self._ujson_ibex_fi_cmd()
# CharHardenedCheck3Unimps command.
time.sleep(0.01)
self.target.write(json.dumps("CharHardenedCheck3Unimps").encode("ascii"))

def read_response(self, max_tries: Optional[int] = 1) -> str:
""" Read response from Ibex FI framework.

0 comments on commit e251ad0

Please sign in to comment.