Skip to content

ot_aes: fix IV and CTR issues (cherry-pick #98) #100

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

Merged

Conversation

luismarques
Copy link

This is a cherry-pick of PR #98, that fixes reading the IV registers and properly incrementing the IV values.

To make the OT aes_test.c test pass there is an additional fix required, to not clear (randomize) the IV register. I'll make a follow-up PR.

@luismarques luismarques changed the base branch from ot-darjeeling-9.1.0 to dev/ot-earlgrey-1.0.0-updates January 14, 2025 15:58
@rivos-eblot
Copy link

LGTM, but I think it would be nice to use cherrypick -x to track the original commits (see #93 (review)).

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.

LGTM

@rivos-eblot
Copy link

See #99 for build issues

Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
(cherry picked from commit d224436)
…rent IV value

Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
(cherry picked from commit 9185a7a)
OT HW assumes the IV register in CTR mode exposes the IV of the next iteration once
a round has been completed, while libtomcrypt only updates the CTR value when a new
round is triggered.

Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
(cherry picked from commit 5524365)
@luismarques luismarques merged commit e7b1731 into lowRISC:dev/ot-earlgrey-1.0.0-updates Jan 16, 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.

2 participants