-
Notifications
You must be signed in to change notification settings - Fork 759
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
[sival/aes] Add AES Interrupt Encryption tests #24572
base: master
Are you sure you want to change the base?
Conversation
a19f20c
to
ac6bdc1
Compare
79f90e7
to
4b6f2e1
Compare
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.
Can you add review / commit comments explaining what overall scenario this test tests? I don't suppose there's a testplan testpoint to reference?
|
||
OTTF_DEFINE_TEST_CONFIG(); | ||
|
||
status_t execute_test(void) { |
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.
As this function returns status_t
, you can replace all instances of CHECK_DIF_OK
by TRY
, which would make the code cleaner in my opinion.
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.
Ideally, I want the test code to report FAILURE & abort if the value doesn't get readout correctly , hence using CHECK_DIF_OK
9612844
to
58843a0
Compare
|
58843a0
to
eb2cabc
Compare
@luismarques @engdoreis, Gentle ping on reviewing this PR. I already incorporated the changes from your feedback and waiting for functional checks on the test code (from AES folks) |
Hi @nasahlpa, can you take a look at the test implementation to ensure it matches the intended test point description? Thanks! |
Could you please add the description to the git commit itself? Currently, no description is available in the git commit message. Furthermore, the contributing guideline also mentions that a subject tag should be added to the git commit message. |
The git commit has restrictions on word limit, if I include the entire link, i will run out of the world limit and won't be able to commit successfully. |
Understood. But you could add something like this:
For the header of the git commit message you could use:
|
Thanks Pascal. I will incorporate these changes in the commit message now!
…On Tue, Oct 8, 2024 at 11:24 PM Pascal Nasahl ***@***.***> wrote:
Understood. But you could add something like this:
This commit implements the chip_sw_aes_interrupt_encryption test that is defined in the chip testplan. The purpose of this test is to check, whether an AES encryption can be interrupted and restored.
For the header of the git commit message you could use:
[sival/aes] Add AES interrupt encryption test
—
Reply to this email directly, view it on GitHub
<#24572 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJEK24Y6LO2262A62JNS7SLZ2TD3VAVCNFSM6AAAAABOFTOFTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBRGQYTOMJSGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Signed-off-by: Ramesh Prakash <rprakas@google.com> This commit implements the chip_sw_aes_interrupt_encryption test that is defined in the chip testplan. The purpose of this test is to check, whether an AES encryption can be interrupted and restored.
eb2cabc
to
88ea80a
Compare
Just updated the PR with the commit messages as suggested! |
Thanks! Would you mind looking into the review comments I've added? Especially the question regarding the decryption should be addressed. |
Hi @nasahlpa, I wasn't able to find your comments. Can you double check if they were sent? Thanks |
dif_aes_data_t out_data2; | ||
CHECK_DIF_OK(dif_aes_read_output(&aes, &out_data2)); | ||
CHECK_DIF_OK(dif_aes_end(&aes)); | ||
// Finish the CBC decryption transaction. |
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.
dif_aes_data_t out_data2; | |
CHECK_DIF_OK(dif_aes_read_output(&aes, &out_data2)); | |
CHECK_DIF_OK(dif_aes_end(&aes)); | |
// Finish the CBC decryption transaction. | |
// Finish the CBC decryption transaction. | |
dif_aes_data_t out_data2; | |
CHECK_DIF_OK(dif_aes_read_output(&aes, &out_data2)); | |
CHECK_DIF_OK(dif_aes_end(&aes)); |
@@ -6279,3 +6279,22 @@ opentitan_test( | |||
"//sw/device/lib/testing/test_framework:ottf_utils", | |||
], | |||
) | |||
|
|||
opentitan_test( |
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.
Could you please move this test up to the other AES tests? Alphabetically ordering the bazel entries helps to find the tests easier.
exec_env = { | ||
"//hw/top_earlgrey:fpga_cw340_sival": None, | ||
}, |
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.
exec_env = { | |
"//hw/top_earlgrey:fpga_cw340_sival": None, | |
}, | |
exec_env = dicts.add( | |
EARLGREY_TEST_ENVS, | |
EARLGREY_SILICON_OWNER_ROM_EXT_ENVS, | |
{ | |
"//hw/top_earlgrey:fpga_cw310_sival": None, | |
"//hw/top_earlgrey:fpga_cw340_sival": None, | |
"//hw/top_earlgrey:silicon_creator": None, | |
}, | |
), |
By adding this, you also could run the test in Verilator. @engdoreis do you know whether there is a rule which exec environments a test needs to have?
|
||
CHECK_DIF_OK(dif_aes_start(&aes, &transactiond, &key, &iv)); | ||
|
||
memcpy(cipher_text[0].data, kAesModesCipherTextCbc128, |
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.
Could you please explain what you are trying to achieve with the decryption? I assume you want to take the ciphertext generated from the interrupted AES encryption (dif_aes_t aes
above) and check whether the same plaintext is generated after the decryption? If yes, why are you using kAesModesCipherTextCbc128
as an input for the decryption?
Oh sorry, now the comments should be public. |
Co-authored-by: Pascal Nasahl <pascal@nasahl.net> Signed-off-by: Ramesh Prakash <rprakas@google.com>
Co-authored-by: Pascal Nasahl <pascal@nasahl.net> Signed-off-by: Ramesh Prakash <rprakas@google.com>
@moidx Checking in aes_interrupt_encryption_test.c code and modified the BUILD to include this test.