Skip to content

Commit

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

Signed-off-by: Pascal Nasahl <[email protected]>
  • Loading branch information
nasahlpa committed Feb 14, 2025
1 parent 4f9032b commit 7c9720e
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion hw/ip/aes/dv/tests/aes_alert_reset_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class aes_alert_reset_test extends aes_base_test;

cfg.message_len_min = 7; // 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
2 changes: 1 addition & 1 deletion hw/ip/aes/dv/tests/aes_b2b_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class aes_b2b_test extends aes_base_test;
cfg.message_len_min = 7; // 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
2 changes: 1 addition & 1 deletion hw/ip/aes/dv/tests/aes_clear_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class aes_clear_test extends aes_base_test;

cfg.message_len_min = 17;
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
2 changes: 1 addition & 1 deletion hw/ip/aes/dv/tests/aes_config_error_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class aes_config_error_test extends aes_base_test;

cfg.message_len_min = 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
4 changes: 2 additions & 2 deletions hw/ip/aes/dv/tests/aes_deinit_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class aes_deinit_test extends aes_base_test;
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
2 changes: 1 addition & 1 deletion hw/ip/aes/dv/tests/aes_fi_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class aes_fi_test extends aes_base_test;

cfg.message_len_min = 1; // 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
2 changes: 1 addition & 1 deletion hw/ip/aes/dv/tests/aes_manual_config_err_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class aes_manual_config_err_test extends aes_base_test;

cfg.message_len_min = 16;
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
3 changes: 1 addition & 2 deletions hw/ip/aes/dv/tests/aes_reseed_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ class aes_reseed_test extends aes_base_test;

cfg.message_len_min = 7; // 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
2 changes: 1 addition & 1 deletion hw/ip/aes/dv/tests/aes_sideload_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class aes_sideload_test extends aes_base_test;

cfg.message_len_min = 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
2 changes: 1 addition & 1 deletion hw/ip/aes/dv/tests/aes_smoke_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class aes_smoke_test extends aes_base_test;

cfg.message_len_min = 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
2 changes: 1 addition & 1 deletion hw/ip/aes/dv/tests/aes_stress_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class aes_stress_test extends aes_base_test;
cfg.message_len_min = 7; // 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 7c9720e

Please sign in to comment.