[kmac] incorrect entropy configuration after previously completed hashes
Hi Eunchan,
I see the following when I incorrectly configure entropy_mode after a previous hashing operation has already completed:

The entropy FSM stays in StRandReady after completing the previous hash, so when I write EntropyModeNone to the CFG csr the entropy module never detects a configuration error here, which seems to be incorrect.
WDYT?
Thanks for the issue. The current entropy FSM only checks the mode when the SW sets entropy_ready bit.
I think, it is good to move FSM back to StReset when SW clears the entropy_ready so that it can check the mode again.
And latch the Entropy mode only when it moves from StReset to other state so that the seed cannot be abruptly changed to '0 in case of EntropyModeNone while operating.
One issue I am thinking of: If we ever let the state machine back to StReset, then the entropy module generates dummy entropy to the following modules. It is mainly for ROM_CTRL to check the rom image when no entropy_src , csrng, edn are ready. Issue #6285 describes it.
So, I think we just stick to whatever programmed when the FSM is out from StReset and never go back. WDYT @udinator ?
hmm. That makes sense to me - so we would just configure an entropy mode once per reset.
adding @cindychip for visibility
@eunchan i think this was already fixed? could you close if that's the case?
@eunchan sorry for being late for the discussion. I totally agree with the conclusion - "So, I think we just stick to whatever programmed when the FSM is out from StReset and never go back."
Just to clarify: Basically we cannot change the entropy_mode unless
1). KMAC being reset
2). In error states with err_processed issued.
Do you think we should document it in KMAC spec to clarify the behavior? Thanks, Cindy
OK. Let me add that to register spec.
Thanks Eunchan, appreciate it :)