Skip to content

Commit

Permalink
[sca] OTBN uJSON command handler
Browse files Browse the repository at this point in the history
This PR translates the `sw/device/sca/otbn_vertical/` tests
from simpleserial to uJSON.

Signed-off-by: Pascal Nasahl <[email protected]>
  • Loading branch information
nasahlpa committed Jan 8, 2024
1 parent 00ebed8 commit 65eb013
Show file tree
Hide file tree
Showing 12 changed files with 1,205 additions and 0 deletions.
66 changes: 66 additions & 0 deletions sw/device/tests/crypto/cryptotest/firmware/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,52 @@ 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_ld_silicon_creator_slot_a",
"//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/otbn/crypto:p256_key_from_seed_sca",
"//sw/device/tests/crypto/cryptotest/json:otbn_sca_commands",
],
)

cc_library(
name = "ecc256_modinv_sca",
srcs = ["ecc256_modinv_sca.c"],
hdrs = ["ecc256_modinv_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_ld_silicon_creator_slot_a",
"//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/otbn/crypto:p256_mod_inv_sca",
"//sw/device/tests/crypto/cryptotest/json:otbn_sca_commands",
],
)

cc_library(
name = "ibex_fi",
srcs = ["ibex_fi.c"],
Expand Down Expand Up @@ -82,6 +128,25 @@ cc_library(
],
)

cc_library(
name = "otbn_sca",
srcs = ["otbn_sca.c"],
hdrs = ["otbn_sca.h"],
deps = [
":ecc256_keygen_sca",
":ecc256_modinv_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/crypto/cryptotest/json:otbn_sca_commands",
],
)

cc_library(
name = "prng_sca",
srcs = ["prng_sca.c"],
Expand Down Expand Up @@ -141,6 +206,7 @@ opentitan_binary(
":aes_sca",
":ibex_fi",
":kmac_sca",
":otbn_sca",
":prng_sca",
":sha3_sca",
":trigger_sca",
Expand Down
Loading

0 comments on commit 65eb013

Please sign in to comment.