-
Notifications
You must be signed in to change notification settings - Fork 13
ot_otp: perform partition descrambling in DAI
#252
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
ot_otp: perform partition descrambling in DAI
#252
Conversation
bad7426 to
16c16db
Compare
16c16db to
d735823
Compare
Load the OTP scrambling keys from hex-string configured properties. These keys are used for decoding the scrambled data stored in secret partitions (`SECRET0`, `SECRET1`, etc.) Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
Load the OTP scrambling keys from hex-string configured properties. These keys are used for decoding the scrambled data stored in secret partitions (`SECRET0`, `SECRET1`, etc.) Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
Parse the hard-coded OTP scrambling key constants out of the relevant SV partition SV files into the generated OT configuration files, so that they can be used in the OTP. Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
Unscramble DAI reads from secret partitions, which are scrambled with a scrambling key (configured per-partition as a netlist constant) via a simple Present block cipher. Co-authored-by: Alex Jones <alex.jones@lowrisc.org> Signed-off-by: Luís Marques <luismarques@lowrisc.org> Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
Unscramble DAI reads from secret partitions, which are scrambled with a scrambling key (configured per-partition as a netlist constant) via a simple Present block cipher. Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
These files need to include the new OTP scrambling keys, so regenerate them from the latest commits on the `master` branch (for Darjeeling) and the `earlgrey_1.0.0` branch (for Earlgrey). Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
d735823 to
c70a4cd
Compare
|
This should be working on Earlgrey going via I've tried to add the support for Darjeeling as well, but don't have an easy way to test it. I can see the keys are being parsed into the configuration file correctly at least. @rivos-eblot would it be possible for you could check the Darjeeling implementation? |
ot_otp: perform partition descrambling in DAI
rivos-eblot
left a comment
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
I can give it a try, but I do not know how. Let me check if we have some way to test it and get back to you. |
| except KeyError as exc: | ||
| raise ValueError('No scrambling key constants found') from exc | ||
| if len(key_values) <= idx: | ||
| raise ValueError(f'No such key {name} in the key array') from exc |
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.
Ah, I tried to push this change but you had already merged the PR 😅
| raise ValueError(f'No such key {name} in the key array') from exc | |
| raise ValueError(f'No such key {name} in the key array') |
It'll likely just throw an UnboundLocalError instead of a ValueError on this error case, so not a huge deal.
I'll open a PR to fix this.
The descrambling for the token loading path will be done in a separate PR.