Skip to content

Commit

Permalink
[aes,dv] Set min block length to 0
Browse files Browse the repository at this point in the history
As providing no AAD and no PTX block in AES-GCM mode is also possible,
test this by adapting the corresponding test configs and setting
message_len_min and aad_len_min = 0.

Signed-off-by: Pascal Nasahl <[email protected]>
  • Loading branch information
nasahlpa committed Feb 14, 2025
1 parent 427999d commit d22c38a
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 25 deletions.
4 changes: 2 additions & 2 deletions hw/ip/aes/dv/tests/aes_alert_reset_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class aes_alert_reset_test extends aes_base_test;
cfg.cfb_weight = 10;
cfg.gcm_weight = 10;

cfg.message_len_min = 7; // one block (16bytes=128bits)
cfg.message_len_min = 0; // 16 = one block (16bytes=128bits)
cfg.message_len_max = 300;
cfg.aad_len_min = 7; // one block (16bytes=128bits)
cfg.aad_len_min = 0;
cfg.aad_len_max = 300;
cfg.manual_operation_pct = 0;
cfg.use_key_mask = 0;
Expand Down
4 changes: 2 additions & 2 deletions hw/ip/aes/dv/tests/aes_b2b_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class aes_b2b_test extends aes_base_test;
cfg.cfb_weight = 10;
cfg.gcm_weight = 10;

cfg.message_len_min = 7; // bytes
cfg.message_len_min = 0; // bytes
cfg.message_len_max = 1023; // bytes

cfg.aad_len_min = 7; // bytes
cfg.aad_len_min = 0; // bytes
cfg.aad_len_max = 1023; // bytes

cfg.fixed_data_en = 0;
Expand Down
4 changes: 3 additions & 1 deletion hw/ip/aes/dv/tests/aes_base_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ class aes_base_test extends cip_base_test #(
cfg.write_prob = 80;
cfg.num_messages_min = 1;
cfg.num_messages_max = 31;
cfg.message_len_min = 1;
cfg.message_len_min = 0;
cfg.message_len_max = 599;
cfg.aad_len_min = 0;
cfg.aad_len_max = 599;
cfg.use_key_mask = 0;
cfg.use_c_model_pct = 0;
cfg.error_types = '0;
Expand Down
4 changes: 2 additions & 2 deletions hw/ip/aes/dv/tests/aes_clear_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class aes_clear_test extends aes_base_test;
cfg.cfb_weight = 10;
cfg.gcm_weight = 10;

cfg.message_len_min = 17;
cfg.message_len_min = 0;
cfg.message_len_max = 317;
cfg.aad_len_min = 17;
cfg.aad_len_min = 0;
cfg.aad_len_max = 317;
cfg.manual_operation_pct = 30;
cfg.use_key_mask = 0;
Expand Down
4 changes: 2 additions & 2 deletions hw/ip/aes/dv/tests/aes_config_error_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class aes_config_error_test extends aes_base_test;
cfg.cfb_weight = 10;
cfg.gcm_weight = 10;

cfg.message_len_min = 16; // one block (16bytes=128bits)
cfg.message_len_min = 0; // 16 = one block (16bytes=128bits)
cfg.message_len_max = 32; //
cfg.aad_len_min = 16; // one block (16bytes=128bits)
cfg.aad_len_min = 0; //
cfg.aad_len_max = 32; //
cfg.manual_operation_pct = 5;
cfg.use_key_mask = 0;
Expand Down
6 changes: 3 additions & 3 deletions hw/ip/aes/dv/tests/aes_deinit_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class aes_deinit_test extends aes_base_test;
cfg.cfb_weight = 10;
cfg.gcm_weight = 10;

cfg.message_len_min = 16; // one block (16bytes=128bits)
cfg.message_len_min = 0; // 16 = one block (16bytes=128bits)
cfg.message_len_max = 128; //
cfg.manual_operation_pct = 0;

cfg.aad_len_min = 16; // one block (16bytes=128bits)
cfg.aad_len_max = 128; //
cfg.aad_len_min = 0;
cfg.aad_len_max = 128;

cfg.fixed_data_en = 0;
cfg.fixed_key_en = 0;
Expand Down
4 changes: 2 additions & 2 deletions hw/ip/aes/dv/tests/aes_fi_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class aes_fi_test extends aes_base_test;
cfg.ctr_weight = 75;
cfg.gcm_weight = 5;

cfg.message_len_min = 1; // one block (16bytes=128bits)
cfg.message_len_min = 0; // 16 = one block (16bytes=128bits)
cfg.message_len_max = 65;
cfg.aad_len_min = 1; // one block (16bytes=128bits)
cfg.aad_len_min = 0;
cfg.aad_len_max = 65;
cfg.manual_operation_pct = 0;
cfg.use_key_mask = 0;
Expand Down
4 changes: 2 additions & 2 deletions hw/ip/aes/dv/tests/aes_manual_config_err_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ class aes_manual_config_err_test extends aes_base_test;
cfg.cfb_weight = 10;
cfg.gcm_weight = 10;

cfg.message_len_min = 16;
cfg.message_len_min = 0;
cfg.message_len_max = 128;
cfg.aad_len_min = 16;
cfg.aad_len_min = 0;
cfg.aad_len_max = 128;
cfg.manual_operation_pct = 0;

Expand Down
5 changes: 2 additions & 3 deletions hw/ip/aes/dv/tests/aes_reseed_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ class aes_reseed_test extends aes_base_test;
cfg.cfb_weight = 10;
cfg.gcm_weight = 10;

cfg.message_len_min = 7; // bytes
cfg.message_len_min = 0; // bytes
cfg.message_len_max = 1023; // bytes

cfg.aad_len_min = 7; // bytes
cfg.aad_len_min = 0; //
cfg.aad_len_max = 1023; // bytes

cfg.fixed_data_en = 0;
Expand Down
4 changes: 2 additions & 2 deletions hw/ip/aes/dv/tests/aes_sideload_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class aes_sideload_test extends aes_base_test;
cfg.cfb_weight = 10;
cfg.gcm_weight = 10;

cfg.message_len_min = 16; // one block (16bytes=128bits)
cfg.message_len_min = 0; // 16 = one block (16bytes=128bits)
cfg.message_len_max = 128; //
cfg.aad_len_min = 16; // one block (16bytes=128bits)
cfg.aad_len_min = 0; //
cfg.aad_len_max = 128; //
cfg.manual_operation_pct = 50; // only non sideload messages
cfg.use_key_mask = 0;
Expand Down
4 changes: 2 additions & 2 deletions hw/ip/aes/dv/tests/aes_smoke_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class aes_smoke_test extends aes_base_test;
cfg.cfb_weight = 10;
cfg.gcm_weight = 10;

cfg.message_len_min = 16; // one block (16bytes=128bits)
cfg.message_len_min = 0; // 16 = one block (16bytes=128bits)
cfg.message_len_max = 32; //
cfg.aad_len_min = 16; // one block (16bytes=128bits)
cfg.aad_len_min = 0; //
cfg.aad_len_max = 32; //
cfg.manual_operation_pct = 50;
cfg.use_key_mask = 0;
Expand Down
4 changes: 2 additions & 2 deletions hw/ip/aes/dv/tests/aes_stress_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class aes_stress_test extends aes_base_test;
cfg.cfb_weight = 10;
cfg.gcm_weight = 10;

cfg.message_len_min = 7; // bytes
cfg.message_len_min = 0; // bytes
cfg.message_len_max = 1023; // bytes

cfg.aad_len_min = 7; // bytes
cfg.aad_len_min = 0; // bytes
cfg.aad_len_max = 1023; // bytes

cfg.fixed_data_en = 0;
Expand Down

0 comments on commit d22c38a

Please sign in to comment.