-
Notifications
You must be signed in to change notification settings - Fork 791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pentest] Batch mode for Ibex SCA #22272
[pentest] Batch mode for Ibex SCA #22272
Conversation
eb449e6
to
c707694
Compare
This commit adds the command handler for: - ibex_sca_tl_write_batch_fvsr - ibex_sca_tl_write_batch_fvsr_fix_address - ibex_sca_tl_write_batch_random - ibex_sca_tl_write_batch_random_fix_address - ibex_sca_tl_write_fvsr - ibex_sca_tl_write_random - ibex_sca_tl_read_batch_fvsr - ibex_sca_tl_read_batch_fvsr_fix_address - ibex_sca_tl_read_batch_random - ibex_sca_tl_read_batch_random_fix_address - ibex_sca_tl_read_fvsr - ibex_sca_tl_read_random - ibex_sca_register_file_write_batch_fvsr - ibex_sca_register_file_write_batch_random - ibex_sca_register_file_write_fvsr - ibex_sca_register_file_write_random - ibex_sca_register_file_read_batch_fvsr - ibex_sca_register_file_read_batch_random - ibex_sca_register_file_read_fvsr The device code is located in lowRISC/opentitan#22272 Signed-off-by: Pascal Nasahl <[email protected]>
c707694
to
9813613
Compare
This commit adds the command handler for: - ibex_sca_tl_write_batch_fvsr - ibex_sca_tl_write_batch_fvsr_fix_address - ibex_sca_tl_write_batch_random - ibex_sca_tl_write_batch_random_fix_address - ibex_sca_tl_write_fvsr - ibex_sca_tl_write_random - ibex_sca_tl_read_batch_fvsr - ibex_sca_tl_read_batch_fvsr_fix_address - ibex_sca_tl_read_batch_random - ibex_sca_tl_read_batch_random_fix_address - ibex_sca_tl_read_fvsr - ibex_sca_tl_read_random - ibex_sca_register_file_write_batch_fvsr - ibex_sca_register_file_write_batch_random - ibex_sca_register_file_write_fvsr - ibex_sca_register_file_write_random - ibex_sca_register_file_read_batch_fvsr - ibex_sca_register_file_read_batch_random - ibex_sca_register_file_read_fvsr - ibex_sca_register_file_read_random - ibex_fi_char_sram_write The device code is located in lowRISC/opentitan#22272 Signed-off-by: Pascal Nasahl <[email protected]>
This commit adds the command handler for: - ibex_sca_tl_write_batch_fvsr - ibex_sca_tl_write_batch_fvsr_fix_address - ibex_sca_tl_write_batch_random - ibex_sca_tl_write_batch_random_fix_address - ibex_sca_tl_write_fvsr - ibex_sca_tl_write_random - ibex_sca_tl_read_batch_fvsr - ibex_sca_tl_read_batch_fvsr_fix_address - ibex_sca_tl_read_batch_random - ibex_sca_tl_read_batch_random_fix_address - ibex_sca_tl_read_fvsr - ibex_sca_tl_read_random - ibex_sca_register_file_write_batch_fvsr - ibex_sca_register_file_write_batch_random - ibex_sca_register_file_write_fvsr - ibex_sca_register_file_write_random - ibex_sca_register_file_read_batch_fvsr - ibex_sca_register_file_read_batch_random - ibex_sca_register_file_read_fvsr - ibex_sca_register_file_read_random - ibex_fi_char_sram_write The device code is located in lowRISC/opentitan#22272 Signed-off-by: Pascal Nasahl <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nasahlpa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
for (int i = 0; i < uj_data.num_iterations; i++) { | ||
// Initialize temporary registers with reference values. | ||
asm volatile("mv x5, %0" : : "r"(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to a static function and share across the file? (DRY principle)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the generation of the random values? I've created a two static functions for generating random and FvsR values instead of repeating the same code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean this asm block that initializes temp registers with values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if adding a function that initializes x5, x6, x7, x28, x29, x30
works. When having a function call to such an initialization function, is it guaranteed that these registers contain the values I am expecting after returning from the function? These registers are temporary registers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, inline function or macro? something to help keep everything in sync over time that still satisfies your constraints. I.e., if you change something, you have to change it everywhere, makes things hard to maintain. Unless there are SCA reasons you have like you stated below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks :)
6cc7c4b
to
b018806
Compare
|
||
for (int i = 0; i < uj_data.num_iterations; i++) { | ||
// Initialize temporary registers with reference values. | ||
asm volatile("mv x5, %0" : : "r"(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean this asm block that initializes temp registers with values
b018806
to
1faf819
Compare
a561652
to
97389d8
Compare
This commit adds the following new FI and SCA ibex tests: - ibex_sca_tl_write_batch_fvsr - ibex_sca_tl_write_batch_fvsr_fix_address - ibex_sca_tl_write_batch_random - ibex_sca_tl_write_batch_random_fix_address - ibex_sca_tl_write_fvsr - ibex_sca_tl_write_random - ibex_sca_tl_read_batch_fvsr - ibex_sca_tl_read_batch_fvsr_fix_address - ibex_sca_tl_read_batch_random - ibex_sca_tl_read_batch_random_fix_address - ibex_sca_tl_read_fvsr - ibex_sca_tl_read_random - ibex_sca_register_file_write_batch_fvsr - ibex_sca_register_file_write_batch_random - ibex_sca_register_file_write_fvsr - ibex_sca_register_file_write_random - ibex_sca_register_file_read_batch_fvsr - ibex_sca_register_file_read_batch_random - ibex_sca_register_file_read_fvsr - ibex_sca_register_file_read_random - ibex_fi_char_sram_static The host code is located in lowRISC/ot-sca#349. Signed-off-by: Pascal Nasahl <[email protected]>
This commit adds the command handler for the ibex_char_sram_write test. The device PR is located in lowRISC/opentitan#22272 Signed-off-by: Pascal Nasahl <[email protected]>
This commit adds the command handler for: - ibex_sca_tl_write_batch_fvsr - ibex_sca_tl_write_batch_fvsr_fix_address - ibex_sca_tl_write_batch_random - ibex_sca_tl_write_batch_random_fix_address - ibex_sca_tl_write_fvsr - ibex_sca_tl_write_random - ibex_sca_tl_read_batch_fvsr - ibex_sca_tl_read_batch_fvsr_fix_address - ibex_sca_tl_read_batch_random - ibex_sca_tl_read_batch_random_fix_address - ibex_sca_tl_read_fvsr - ibex_sca_tl_read_random - ibex_sca_register_file_write_batch_fvsr - ibex_sca_register_file_write_batch_random - ibex_sca_register_file_write_fvsr - ibex_sca_register_file_write_random - ibex_sca_register_file_read_batch_fvsr - ibex_sca_register_file_read_batch_random - ibex_sca_register_file_read_fvsr - ibex_sca_register_file_read_random - ibex_fi_char_sram_write The device code is located in lowRISC/opentitan#22272 Signed-off-by: Pascal Nasahl <[email protected]>
This commit adds the command handler for: - ibex_sca_tl_write_batch_fvsr - ibex_sca_tl_write_batch_fvsr_fix_address - ibex_sca_tl_write_batch_random - ibex_sca_tl_write_batch_random_fix_address - ibex_sca_tl_write_fvsr - ibex_sca_tl_write_random - ibex_sca_tl_read_batch_fvsr - ibex_sca_tl_read_batch_fvsr_fix_address - ibex_sca_tl_read_batch_random - ibex_sca_tl_read_batch_random_fix_address - ibex_sca_tl_read_fvsr - ibex_sca_tl_read_random - ibex_sca_register_file_write_batch_fvsr - ibex_sca_register_file_write_batch_random - ibex_sca_register_file_write_fvsr - ibex_sca_register_file_write_random - ibex_sca_register_file_read_batch_fvsr - ibex_sca_register_file_read_batch_random - ibex_sca_register_file_read_fvsr - ibex_sca_register_file_read_random - ibex_fi_char_sram_write The device code is located in lowRISC/opentitan#22272 Signed-off-by: Pascal Nasahl <[email protected]>
Sorry for the long delay with the rebase - after the rebase the firmware was too large for the memory and I had to separate the pen. tests from the crypto tests (see #22450). I hope we can merge this soon - the failing tests in CI are not related to this PR. |
7f7dbbc
into
lowRISC:earlgrey_es_sival
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin master
git worktree add -d .worktree/backport-22272-to-master origin/master
cd .worktree/backport-22272-to-master
git switch --create backport-22272-to-master
git cherry-pick -x 773655502cf220ab0035bd2b5f924d7153be8e71 |
This commit adds the command handler for: - ibex_sca_tl_write_batch_fvsr - ibex_sca_tl_write_batch_fvsr_fix_address - ibex_sca_tl_write_batch_random - ibex_sca_tl_write_batch_random_fix_address - ibex_sca_tl_write_fvsr - ibex_sca_tl_write_random - ibex_sca_tl_read_batch_fvsr - ibex_sca_tl_read_batch_fvsr_fix_address - ibex_sca_tl_read_batch_random - ibex_sca_tl_read_batch_random_fix_address - ibex_sca_tl_read_fvsr - ibex_sca_tl_read_random - ibex_sca_register_file_write_batch_fvsr - ibex_sca_register_file_write_batch_random - ibex_sca_register_file_write_fvsr - ibex_sca_register_file_write_random - ibex_sca_register_file_read_batch_fvsr - ibex_sca_register_file_read_batch_random - ibex_sca_register_file_read_fvsr - ibex_sca_register_file_read_random - ibex_fi_char_sram_write The device code is located in lowRISC/opentitan#22272 and the binary was compiled from lowRISC/opentitan@7f7dbbc Signed-off-by: Pascal Nasahl <[email protected]>
This commit adds the command handler for: - ibex_sca_tl_write_batch_fvsr - ibex_sca_tl_write_batch_fvsr_fix_address - ibex_sca_tl_write_batch_random - ibex_sca_tl_write_batch_random_fix_address - ibex_sca_tl_write_fvsr - ibex_sca_tl_write_random - ibex_sca_tl_read_batch_fvsr - ibex_sca_tl_read_batch_fvsr_fix_address - ibex_sca_tl_read_batch_random - ibex_sca_tl_read_batch_random_fix_address - ibex_sca_tl_read_fvsr - ibex_sca_tl_read_random - ibex_sca_register_file_write_batch_fvsr - ibex_sca_register_file_write_batch_random - ibex_sca_register_file_write_fvsr - ibex_sca_register_file_write_random - ibex_sca_register_file_read_batch_fvsr - ibex_sca_register_file_read_batch_random - ibex_sca_register_file_read_fvsr - ibex_sca_register_file_read_random - ibex_fi_char_sram_write The device code is located in lowRISC/opentitan#22272 and the binary was compiled from lowRISC/opentitan@7f7dbbc Signed-off-by: Pascal Nasahl <[email protected]>
This commit adds the command handler for: - ibex_sca_tl_write_batch_fvsr - ibex_sca_tl_write_batch_fvsr_fix_address - ibex_sca_tl_write_batch_random - ibex_sca_tl_write_batch_random_fix_address - ibex_sca_tl_write_fvsr - ibex_sca_tl_write_random - ibex_sca_tl_read_batch_fvsr - ibex_sca_tl_read_batch_fvsr_fix_address - ibex_sca_tl_read_batch_random - ibex_sca_tl_read_batch_random_fix_address - ibex_sca_tl_read_fvsr - ibex_sca_tl_read_random - ibex_sca_register_file_write_batch_fvsr - ibex_sca_register_file_write_batch_random - ibex_sca_register_file_write_fvsr - ibex_sca_register_file_write_random - ibex_sca_register_file_read_batch_fvsr - ibex_sca_register_file_read_batch_random - ibex_sca_register_file_read_fvsr - ibex_sca_register_file_read_random - ibex_fi_char_sram_write The device code is located in lowRISC/opentitan#22272 and the binary was compiled from lowRISC/opentitan@7f7dbbc Signed-off-by: Pascal Nasahl <[email protected]>
This commit adds the command handler for: - ibex_sca_tl_write_batch_fvsr - ibex_sca_tl_write_batch_fvsr_fix_address - ibex_sca_tl_write_batch_random - ibex_sca_tl_write_batch_random_fix_address - ibex_sca_tl_write_fvsr - ibex_sca_tl_write_random - ibex_sca_tl_read_batch_fvsr - ibex_sca_tl_read_batch_fvsr_fix_address - ibex_sca_tl_read_batch_random - ibex_sca_tl_read_batch_random_fix_address - ibex_sca_tl_read_fvsr - ibex_sca_tl_read_random - ibex_sca_register_file_write_batch_fvsr - ibex_sca_register_file_write_batch_random - ibex_sca_register_file_write_fvsr - ibex_sca_register_file_write_random - ibex_sca_register_file_read_batch_fvsr - ibex_sca_register_file_read_batch_random - ibex_sca_register_file_read_fvsr - ibex_sca_register_file_read_random - ibex_fi_char_sram_write The device code is located in lowRISC/opentitan#22272 and the binary was compiled from lowRISC/opentitan@7f7dbbc Signed-off-by: Pascal Nasahl <[email protected]>
This commit adds the command handler for: - ibex_sca_tl_write_batch_fvsr - ibex_sca_tl_write_batch_fvsr_fix_address - ibex_sca_tl_write_batch_random - ibex_sca_tl_write_batch_random_fix_address - ibex_sca_tl_write_fvsr - ibex_sca_tl_write_random - ibex_sca_tl_read_batch_fvsr - ibex_sca_tl_read_batch_fvsr_fix_address - ibex_sca_tl_read_batch_random - ibex_sca_tl_read_batch_random_fix_address - ibex_sca_tl_read_fvsr - ibex_sca_tl_read_random - ibex_sca_register_file_write_batch_fvsr - ibex_sca_register_file_write_batch_random - ibex_sca_register_file_write_fvsr - ibex_sca_register_file_write_random - ibex_sca_register_file_read_batch_fvsr - ibex_sca_register_file_read_batch_random - ibex_sca_register_file_read_fvsr - ibex_sca_register_file_read_random - ibex_fi_char_sram_write The device code is located in lowRISC/opentitan#22272 and the binary was compiled from lowRISC/opentitan@7f7dbbc Signed-off-by: Pascal Nasahl <[email protected]>
This commit adds the command handler for: - ibex_sca_tl_write_batch_fvsr - ibex_sca_tl_write_batch_fvsr_fix_address - ibex_sca_tl_write_batch_random - ibex_sca_tl_write_batch_random_fix_address - ibex_sca_tl_write_fvsr - ibex_sca_tl_write_random - ibex_sca_tl_read_batch_fvsr - ibex_sca_tl_read_batch_fvsr_fix_address - ibex_sca_tl_read_batch_random - ibex_sca_tl_read_batch_random_fix_address - ibex_sca_tl_read_fvsr - ibex_sca_tl_read_random - ibex_sca_register_file_write_batch_fvsr - ibex_sca_register_file_write_batch_random - ibex_sca_register_file_write_fvsr - ibex_sca_register_file_write_random - ibex_sca_register_file_read_batch_fvsr - ibex_sca_register_file_read_batch_random - ibex_sca_register_file_read_fvsr - ibex_sca_register_file_read_random - ibex_fi_char_sram_write The device code is located in lowRISC/opentitan#22272 and the binary was compiled from lowRISC/opentitan@7f7dbbc Signed-off-by: Pascal Nasahl <[email protected]>
This commit adds the command handler for the ibex_char_sram_write test. The device PR is located in lowRISC/opentitan#22272 Signed-off-by: Pascal Nasahl <[email protected]>
This commit adds the following new FI and SCA ibex tests:
The host code is located in lowRISC/ot-sca#349