Skip to content

Conversation

AlexJones0
Copy link

@AlexJones0 AlexJones0 commented Dec 17, 2024

This PR updates the ROM Control to match Earlgrey's latest functionality. See the commit messages for more details.

This PR also contains a commit to update pyot.py, to allow for the use of aliases in test-specific configuration values. Please let me know if there's already a way to do this - it didn't seem to be working for me, and I've found it a useful feature for e.g. using a specific ROM for a specific test.

This has been tested against the test kmac_app_rom_test_fpga_cw310_rom_with_fake_keys, using the built mask_rom_fpga_cw310.39.scr.vmem produced by the test, which was failing previously, but now passes. The test and mask ROM were built from master on OpenTitan.

For Earlgrey, the number of PRINCE cipher half rounds was increased from
2 to 3 (5 effective rounds to 7 effective rounds, including the
substitution perm rounds). This was added for improved security, and
requires a simple constant change.
In Earlgrey, the S&P layer has been removed from the data scrambling
logic, which affects the scrambling of the generated ROM. The
functionality is removed entirely from the ROM Control to improve error
detection guarantees, interactions with ECC, and timing.

This commit removes the now-redundant logic related to the S&P layer,
instead directly unscrambling words by XORing the keystream and the
`scr`/`in` data.
Copy link

@rivos-eblot rivos-eblot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok to me (from a code standpoint only, I have not checked the HW doc for the new ROM implementation)

Copy link

@jwnrt jwnrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@jwnrt jwnrt merged commit 6303248 into lowRISC:dev/ot-earlgrey-1.0.0-updates Jan 2, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants