Skip to content

Commit

Permalink
[pentest] Add RNG FI tests
Browse files Browse the repository at this point in the history
This commit pulls over the following tests from the pentest_edn
branch of nasahlpa/opentitan that has been used for the penetration testing:
- rng_fi_entropy_src_bias
- rng_fi_firmware_override
- rng_fi_edn_bias
- rng_fi_edn_resp_ack
- csrng_bias

Signed-off-by: Pascal Nasahl <[email protected]>
  • Loading branch information
nasahlpa authored and vogelpi committed Aug 30, 2024
1 parent c30cbd3 commit b4d17c9
Show file tree
Hide file tree
Showing 10 changed files with 752 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sw/device/tests/penetrationtests/firmware/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ package(default_visibility = ["//visibility:public"])
FIRMWARE_DEPS_FPGA = [
"//sw/device/tests/penetrationtests/firmware/fi:ibex_fi",
"//sw/device/tests/penetrationtests/firmware/fi:otbn_fi",
"//sw/device/tests/penetrationtests/firmware/fi:rng_fi",
"//sw/device/tests/penetrationtests/firmware/sca:aes_sca",
"//sw/device/tests/penetrationtests/firmware/sca:ibex_sca",
"//sw/device/tests/penetrationtests/firmware/sca:kmac_sca",
Expand All @@ -36,6 +37,7 @@ FIRMWARE_DEPS_FPGA = [
FIRMWARE_DEPS_FI = [
"//sw/device/tests/penetrationtests/firmware/fi:ibex_fi",
"//sw/device/tests/penetrationtests/firmware/fi:otbn_fi",
"//sw/device/tests/penetrationtests/firmware/fi:rng_fi",
"//sw/device/tests/penetrationtests/firmware/lib:extclk_sca_fi",
"//sw/device/lib/base:csr",
"//sw/device/lib/base:status",
Expand Down
25 changes: 25 additions & 0 deletions sw/device/tests/penetrationtests/firmware/fi/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,28 @@ cc_library(
"//sw/device/tests/penetrationtests/json:otbn_fi_commands",
],
)

cc_library(
name = "rng_fi",
srcs = ["rng_fi.c"],
hdrs = ["rng_fi.h"],
deps = [
"//sw/device/lib/base:memory",
"//sw/device/lib/base:status",
"//sw/device/lib/dif:csrng",
"//sw/device/lib/dif:csrng_shared",
"//sw/device/lib/dif:edn",
"//sw/device/lib/dif:entropy_src",
"//sw/device/lib/dif:rv_core_ibex",
"//sw/device/lib/runtime:log",
"//sw/device/lib/testing:csrng_testutils",
"//sw/device/lib/testing:edn_testutils",
"//sw/device/lib/testing:entropy_testutils",
"//sw/device/lib/testing:rv_core_ibex_testutils",
"//sw/device/lib/testing/test_framework:ujson_ottf",
"//sw/device/lib/ujson",
"//sw/device/sca/lib:sca",
"//sw/device/tests/penetrationtests/firmware/lib:sca_lib",
"//sw/device/tests/penetrationtests/json:rng_fi_commands",
],
)
Loading

0 comments on commit b4d17c9

Please sign in to comment.