opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

[kmac] starting rom/otp application hash

Open udinator opened this issue 5 years ago • 2 comments

Hi Eunchan,

In the KMAC application interface, Keymgr is the only app that needs to send in a sideload key as it runs full KMAC hash, whereas rom_ctrl/otp_ctrl apps only run CShake and only need a prefix to be provided.

However in kmac_app.sv::332 in StIdle:

StIdle: begin
  if (arb_valid && keymgr_key_i.valid) begin
    st_d = StAppCfg;
    set_appid = 1'b1;
  end
  ...
end

But, RTL requires sideloaded key to kick off any app hashing, which seems incorrect - with this the DUT hangs if I try and start a ROM/OTP hash since I'm not providing any sideloaded key. This shouldn't need to be qualified with keymgr_key_i.valid, as we do an error check later on in StAppCfg - just qualifying on arb_valid should be ok here. WDYT?

udinator avatar Apr 27 '21 23:04 udinator

I agree. Thanks for finding this. Let me revise the state transition and make it run without the sideloaded key in SHA3 and cSHAKE cases.

eunchan avatar Apr 28 '21 21:04 eunchan

Udi, could you please close this issue if the merged design works?

eunchan avatar Apr 28 '21 22:04 eunchan