-
Notifications
You must be signed in to change notification settings - Fork 812
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
[sca] Add AES fixed-vs-random Data capture mode #20821
Conversation
vrozic
commented
Jan 12, 2024
•
edited
Loading
edited
- The first commit modifies aes-fvsr-key-batch capture to be consistent with other captures and to update outdated comments.
- The second commit modifies LFSR functions to enable running multiple LFSR
- The third commit enables AES serial fixed-vs-random data capture
- The last commit does the same for uJSON
38191bd
to
6262a0f
Compare
New binaries generated from lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are generated from lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[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 @vrozic for working on this. I have some questions regarding the additional PRNG and the storing of the key (fixed and equal for both sets).
Note that so far I've reviewed the simpleserial side only. Let's first iterate on this and then carry the final changes over to the uJSON implementation. At this point, it will be good if also @nasahlpa can review. |
c1e6194
to
e1133c7
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.
Thanks for making these changes and explaining the need for the LFSR context. The simple_serial implementation looks good to me now modulo one question regarding reseeding the second LFSR.
// Initial state of the prng | ||
static const uint32_t kPrngInitialState = 0x99999999; |
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.
It would be great if this initial state could be provided via simpleserial. Because right now it's fixed at compile time. As this PR already alters the command, you could easily also add a second uint32 value with the LFSR seed. Do you think this would be feasible?
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've now added a separate command aes_serial_seed_lfsr_order
to re-seed the second LFSR.
This way, it's easier to handle from the ot-sca side. The user just needs to run this command after aes_serial_set_default_values
and before aes_serial_fvsr_data_batch_encrypt
.
I've also kept the default value of 0x99999999
in case that the user doesn't want to use this feature.
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 @vrozic , I had a look into the uJSON code only - that looks good.
As we need to use the sival branch to build uJSON SCA-binaries, could you please add the CherryPick:earlgrey_es_sival label to this PR? This ensures that this PR also gets merged into the sival branch.
Support for the new uJSON command is not yet implemented on the ot-sca side? Just let me know if I can support you there, it would be good to keep host and device side functionality as close together as possible.
5e9dcc7
to
b934388
Compare
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
This commit ammends AES fixed-vs-random key dataset capture: 1. Updates the outdated description of the PRNG used for data generation 2. Acknowledges command in aes_serial capture method. This change improves the stability of measurements. 3. Returns the full 16B ciphertect of the last encryption in the batch. This is changed from only sending the last 4 bytes. This change makes it consistent with other batch measurements, making the code easier to maintain. Signed-off-by: Vladimir Rozic <[email protected]>
At the moment, a 32-bit SW LFSR is used for masking data shares sent from IBEX to crypto-blocks (AES, KMAC, SHA3). This commit adds a new context to this PRNG so that it can be used for multiple purposes. This is needed to set the stage for implementing aes-fvsr-data capture which makes use of this LFSR to determine the order of measurements. This commit also ammends all files that make use of the lfsr functions. Signed-off-by: Vladimir Rozic <[email protected]>
Signed-off-by: Vladimir Rozic <[email protected]>
Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[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.
LGTM!
Successfully created backport PR for |
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. The simpleserial binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 The uJSON binary was created from lowRISC/opentitan@ecd6e47 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. These binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 Signed-off-by: Vladimir Rozic <[email protected]>
Binaries are updated to support aes-fvsr-data capture. The simpleserial binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 The uJSON binary was created from lowRISC/opentitan@ecd6e47 Signed-off-by: Pascal Nasahl <[email protected]>
Binaries are updated to support aes-fvsr-data capture. The simpleserial binaries are generated from: https://github.com/vrozic/opentitan/tree/make-binaries-aes-data This branch is created by checking out: https://github.com/lowRISC/opentitan/tree/earlgrey_es_sival and cherry-picking commits from OpenTitan PR #20821: lowRISC/opentitan#20821 The uJSON binary was created from lowRISC/opentitan@ecd6e47 Signed-off-by: Pascal Nasahl <[email protected]>