Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kmac, sival] Keymgr-state-agnostic kmac_sideload_functest #25898

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions sw/device/tests/crypto/BUILD
Original file line number Diff line number Diff line change
@@ -516,13 +516,8 @@ opentitan_test(
opentitan_test(
name = "kdf_kmac_sideload_functest_hardcoded",
srcs = ["kdf_kmac_sideload_functest.c"],
broken = fpga_params(tags = ["broken"]),
exec_env = dicts.add(
EARLGREY_TEST_ENVS,
{
# FIXME broken in sival ROM_EXT, remove this line when fixed. See #21706.
"//hw/top_earlgrey:fpga_cw310_sival_rom_ext": "broken",
},
),
verilator = verilator_params(
timeout = "long",
@@ -544,13 +539,8 @@ opentitan_test(
opentitan_test(
name = "kmac_sideload_functest_hardcoded",
srcs = ["kmac_sideload_functest.c"],
broken = fpga_params(tags = ["broken"]),
exec_env = dicts.add(
EARLGREY_TEST_ENVS,
{
# FIXME broken in sival ROM_EXT, remove this line when fixed. See #21706.
"//hw/top_earlgrey:fpga_cw310_sival_rom_ext": "broken",
},
),
verilator = verilator_params(
timeout = "long",
16 changes: 8 additions & 8 deletions sw/device/tests/crypto/kdf_kmac_sideload_functest.c
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ static kdf_kmac_test_vector_t kKdfTestVectors[] = {
.keyblob_length = 32,
.keyblob =
(uint32_t[]){
0x00000002,
0x00000000,
0xa0d0e9b4,
0x7e790e8b,
0x2ed764b2,
@@ -136,7 +136,7 @@ static kdf_kmac_test_vector_t kKdfTestVectors[] = {
.keyblob_length = 32,
.keyblob =
(uint32_t[]){
0x0000000f,
0x00000000,
0x1600a35a,
0x6f03675a,
0x6b0d549b,
@@ -218,7 +218,7 @@ static kdf_kmac_test_vector_t kKdfTestVectors[] = {
.keyblob_length = 32,
.keyblob =
(uint32_t[]){
0x00000001,
0x00000000,
0xe5f6db1d,
0x9acd8acd,
0x14b044d7,
@@ -426,12 +426,12 @@ bool test_main(void) {
// Initialize keymgr and advance to CreatorRootKey state.
dif_keymgr_t keymgr;
dif_kmac_t kmac;
CHECK_STATUS_OK(keymgr_testutils_startup(&keymgr, &kmac));
CHECK_STATUS_OK(keymgr_testutils_initialize(&keymgr, &kmac));

CHECK_STATUS_OK(keymgr_testutils_advance_state(&keymgr, &kOwnerIntParams));
CHECK_STATUS_OK(keymgr_testutils_check_state(
&keymgr, kDifKeymgrStateOwnerIntermediateKey));
LOG_INFO("Keymgr entered OwnerIntKey State");
const char *state_name;
CHECK_STATUS_OK(keymgr_testutils_state_string_get(&keymgr, &state_name));

LOG_INFO("Keymgr entered %s State", state_name);
LOG_INFO("Testing cryptolib KDF-KMAC driver with sideloaded key.");

// Initialize the core with default parameters
16 changes: 8 additions & 8 deletions sw/device/tests/crypto/kmac_sideload_functest.c
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ static kmac_test_vector_t kKmacTestVectors[] = {
.keyblob_length = 32,
.keyblob =
(uint32_t[]){
0x00000001,
0x00000000,
0x47464544,
0x4b4a4948,
0x4f4e4d4c,
@@ -112,7 +112,7 @@ static kmac_test_vector_t kKmacTestVectors[] = {
.keyblob_length = 32,
.keyblob =
(uint32_t[]){
0x00000002,
0x00000000,
0x11111111,
0x4b4a4948,
0x4f4e4d4c,
@@ -191,7 +191,7 @@ static kmac_test_vector_t kKmacTestVectors[] = {
.keyblob_length = 32,
.keyblob =
(uint32_t[]){
0x00000001,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
@@ -371,12 +371,12 @@ bool test_main(void) {
// Initialize keymgr and advance to CreatorRootKey state.
dif_keymgr_t keymgr;
dif_kmac_t kmac;
CHECK_STATUS_OK(keymgr_testutils_startup(&keymgr, &kmac));
CHECK_STATUS_OK(keymgr_testutils_initialize(&keymgr, &kmac));

const char *state_name;
CHECK_STATUS_OK(keymgr_testutils_state_string_get(&keymgr, &state_name));

CHECK_STATUS_OK(keymgr_testutils_advance_state(&keymgr, &kOwnerIntParams));
CHECK_STATUS_OK(keymgr_testutils_check_state(
&keymgr, kDifKeymgrStateOwnerIntermediateKey));
LOG_INFO("Keymgr entered OwnerIntKey State");
LOG_INFO("Keymgr entered %s State", state_name);
LOG_INFO("Testing cryptolib KMAC driver with sideloaded key.");

// Initialize the core with default parameters