Skip to content

Commit

Permalink
[aes/rtl] Correct generation of idle signal in manual operation mode
Browse files Browse the repository at this point in the history
Signed-off-by: Pirmin Vogel <[email protected]>
  • Loading branch information
vogelpi committed Jan 9, 2025
1 parent d759588 commit e9055f5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions hw/ip/aes/rtl/aes_control_fsm.sv
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,11 @@ module aes_control_fsm
assign gcm_tag = (mode_i == AES_GCM) & (gcm_phase_i == GCM_TAG);
assign start_gcm_tag = gcm_tag & data_in_new;

// The GHASH block is idle whenever it's ready to receive inputs and where not about to start
// a GCM related operation.
assign ghash_idle = ghash_in_ready_i & ~(start_gcm_init | start_gcm | start_gcm_tag);
// The GHASH block is idle whenever it's ready to receive inputs and we're not about to start
// a GCM related operation. For simplicity, the latter condition is not factored into the
// ghash_idle signal but into the idle signal directly. This is done via the start signal,
// meaning also invalid configurations, alerts and manual operation get handled correctly.
assign ghash_idle = ghash_in_ready_i;

// In GCM, the counter performs inc32() instead of inc128(), i.e., the counter wraps at 32 bits.
assign ctr_inc32_o = (mode_i == AES_GCM);
Expand Down

0 comments on commit e9055f5

Please sign in to comment.