Skip to content

Commit a8d6bbd

Browse files
authored
[RTL] Mask MLDSA private key writes when KV data is present (#237)
* masks writes to MLDSA private key in API access when mlkem msg data from the keyvault is present mlkem msg data is stored in part of the SK memory and could potentially be overwritten partially using the MLDSA private key * MICROSOFT AUTOMATED PIPELINE: Stamp 'user/dev/michnorris/kv_bugfix' with updated timestamp and hash after successful run
1 parent 4c961c1 commit a8d6bbd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.github/workflow_metadata/pr_hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9f509918a32aef8928aa0d046adc9000cc660627986d7977e6e72b0fe2ca57f852d96f6a980044075796b22e1fb3a665
1+
36b15d8b679cff273caa9ec38db99ae9a9b4476879d48f69c81747f082a0a9c800b1def2764c7e220458ae4792d7231e
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1762818050
1+
1762905412

src/abr_top/rtl/abr_ctrl.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ always_comb kv_mlkem_msg_write_data = '0;
913913
always_comb api_sk_raddr = abr_reg_hwif_out.MLDSA_PRIVKEY_OUT.addr[12:2];
914914

915915
always_comb api_sk_reg_wr_dec = abr_reg_hwif_out.MLDSA_PRIVKEY_IN.req & api_sk_waddr inside {[0:31]};
916-
always_comb api_keymem_wr_dec = abr_reg_hwif_out.MLDSA_PRIVKEY_IN.req & api_sk_waddr inside {[31:PRIVKEY_NUM_DWORDS-1]};
916+
always_comb api_keymem_wr_dec = abr_reg_hwif_out.MLDSA_PRIVKEY_IN.req & api_sk_waddr inside {[31:PRIVKEY_NUM_DWORDS-1]} & ~kv_mlkem_msg_data_present;
917917

918918
always_comb api_sk_reg_rd_dec = abr_reg_hwif_out.MLDSA_PRIVKEY_OUT.req & api_sk_raddr inside {[0:31]};
919919
always_comb api_keymem_rd_dec = abr_reg_hwif_out.MLDSA_PRIVKEY_OUT.req & api_sk_raddr inside {[32:PRIVKEY_NUM_DWORDS-1]};

0 commit comments

Comments
 (0)