Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions sw/device/lib/crypto/impl/ecc_p256.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,14 @@ otcrypto_status_t otcrypto_ecdh_p256_async_finalize(
// Set the checksum.
shared_secret->checksum = otcrypto_integrity_blinded_checksum(shared_secret);

// Shred ss.
HARDENED_TRY(hardened_memshred(ss.x_share0, ARRAYSIZE(ss.x_share0)));
HARDENED_TRY(hardened_memshred(ss.x_share1, ARRAYSIZE(ss.x_share1)));
HARDENED_TRY(hardened_memshred(ss.y_share0, ARRAYSIZE(ss.y_share0)));
HARDENED_TRY(hardened_memshred(ss.y_share1, ARRAYSIZE(ss.y_share1)));
HARDENED_TRY(hardened_memshred(share0, ARRAYSIZE(share0)));
HARDENED_TRY(hardened_memshred(share1, ARRAYSIZE(share1)));

// Clear the OTBN sideload slot (in case the seed was sideloaded).
return otcrypto_eval_exit(keymgr_dpe_sideload_clear_otbn());
}
Expand Down
4 changes: 4 additions & 0 deletions sw/device/lib/crypto/impl/ecc_p384.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,10 @@ otcrypto_status_t otcrypto_ecdh_p384_async_finalize(
// Set the checksum.
shared_secret->checksum = otcrypto_integrity_blinded_checksum(shared_secret);

// Shred ss.
HARDENED_TRY(hardened_memshred(ss.share0, ARRAYSIZE(ss.share0)));
HARDENED_TRY(hardened_memshred(ss.share1, ARRAYSIZE(ss.share1)));

// Clear the OTBN sideload slot (in case the seed was sideloaded).
return otcrypto_eval_exit(keymgr_dpe_sideload_clear_otbn());
}
Expand Down
Loading