Skip to content

Commit

Permalink
Updated keymgr_dpe key derivation test
Browse files Browse the repository at this point in the history
Signed-off-by: Ravi Sahita <[email protected]>
  • Loading branch information
rsahita committed Dec 11, 2023
1 parent fcaf4d9 commit 6dacd78
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions sw/device/tests/keymgr_dpe_key_derivation_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,32 @@ bool test_main(void) {
&keymgr_dpe, kDifKeymgrDpeStateAvailable));
LOG_INFO("KeymgrDpe updated UDS slot");

CHECK_STATUS_OK(keymgr_dpe_testutils_wait_for_operation_done(&keymgr_dpe));

dif_keymgr_dpe_generate_params_t genparams;
genparams.key_dest = kDifKeymgrDpeKeyDestAes;
genparams.sideload_key = false;

genparams.salt[0] = 0xd;
genparams.salt[1] = 0xe;
genparams.salt[2] = 0xa;
genparams.salt[3] = 0xd;
genparams.salt[4] = 0xb;
genparams.salt[5] = 0xe;
genparams.salt[6] = 0xe;
genparams.salt[7] = 0xf;
genparams.version = 0;
genparams.slot_src_sel = 1;

dif_keymgr_dpe_output_t key;

CHECK_STATUS_OK(keymgr_dpe_testutils_generate(&keymgr_dpe, &genparams, &key));
LOG_INFO("KeymgrDpe generated key:");
for (uint32_t i = 0; i < 2; i++) {
for (uint32_t j = 0; j < 8; j++) {
LOG_INFO("%x ", key.value[i][j]);
}
}

return true;
}

0 comments on commit 6dacd78

Please sign in to comment.