Skip to content

Commit

Permalink
[pentest] Add ECC256 Keygen SCA test
Browse files Browse the repository at this point in the history
This commit adds the ECC256 key generation side-channel
penetration test to the codebase.

The host code is located in lowRISC/ot-sca#347

Signed-off-by: Pascal Nasahl <[email protected]>
  • Loading branch information
nasahlpa committed Apr 16, 2024
1 parent abeb556 commit dcc0422
Show file tree
Hide file tree
Showing 10 changed files with 678 additions and 0 deletions.
42 changes: 42 additions & 0 deletions sw/device/tests/penetrationtests/firmware/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,47 @@ cc_library(
],
)

cc_library(
name = "ecc256_keygen_sca",
srcs = ["ecc256_keygen_sca.c"],
hdrs = ["ecc256_keygen_sca.h"],
deps = [
"//hw/top_earlgrey/sw/autogen:top_earlgrey",
"//sw/device/lib/base:abs_mmio",
"//sw/device/lib/base:memory",
"//sw/device/lib/crypto/drivers:otbn",
"//sw/device/lib/runtime:ibex",
"//sw/device/lib/runtime:log",
"//sw/device/lib/testing:entropy_testutils",
"//sw/device/lib/testing/test_framework:ottf_main",
"//sw/device/lib/testing/test_framework:ujson_ottf",
"//sw/device/lib/ujson",
"//sw/device/sca/lib:prng",
"//sw/device/sca/lib:sca",
"//sw/device/tests/penetrationtests/json:otbn_sca_commands",
"//sw/otbn/crypto:p256_key_from_seed_sca",
],
)

cc_library(
name = "otbn_sca",
srcs = ["otbn_sca.c"],
hdrs = ["otbn_sca.h"],
deps = [
":ecc256_keygen_sca",
"//sw/device/lib/base:memory",
"//sw/device/lib/base:status",
"//sw/device/lib/crypto/impl:status",
"//sw/device/lib/runtime:log",
"//sw/device/lib/testing/test_framework:ujson_ottf",
"//sw/device/lib/ujson",
"//sw/device/sca/lib:prng",
"//sw/device/sca/lib:sca",
"//sw/device/tests/penetrationtests/firmware:sca_lib",
"//sw/device/tests/penetrationtests/json:otbn_sca_commands",
],
)

cc_library(
name = "ibex_fi",
srcs = [
Expand Down Expand Up @@ -227,6 +268,7 @@ FIRMWARE_DEPS = [
":ibex_fi",
":ibex_sca",
":kmac_sca",
":otbn_sca",
":otbn_fi",
":prng_sca",
":sha3_sca",
Expand Down
Loading

0 comments on commit dcc0422

Please sign in to comment.