Skip to content

[cryptolib, ecc] Pre register with randomness before shifting in scalar#30757

Open
h-filali wants to merge 1 commit into
lowRISC:earlgrey_1.0.0from
h-filali:earlgrey_1.0.0
Open

[cryptolib, ecc] Pre register with randomness before shifting in scalar#30757
h-filali wants to merge 1 commit into
lowRISC:earlgrey_1.0.0from
h-filali:earlgrey_1.0.0

Conversation

@h-filali

Copy link
Copy Markdown
Contributor

Backport PR.

(cherry picked from commit 3ad70d3)

@h-filali
h-filali requested a review from andrea-caforio July 15, 2026 10:44
@h-filali
h-filali requested a review from a team as a code owner July 15, 2026 10:44
@h-filali
h-filali requested review from alees24 and removed request for a team July 15, 2026 10:44
@andrea-caforio
andrea-caforio requested review from siemen11 and removed request for alees24 July 15, 2026 11:08

@andrea-caforio andrea-caforio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @h-filali.

@siemen11 siemen11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @h-filali !

@andrea-caforio

Copy link
Copy Markdown
Contributor

@h-filali Can you investigate the CI failures? That's an abnormal amount. Might be worth to check with the infrastructure team.

@h-filali

Copy link
Copy Markdown
Contributor Author

@andrea-caforio having a look!

@h-filali h-filali added the CI:Rerun Rerun failed CI jobs label Jul 15, 2026
@github-actions github-actions Bot removed the CI:Rerun Rerun failed CI jobs label Jul 15, 2026
@h-filali

Copy link
Copy Markdown
Contributor Author

I would expect some ECC tests to fail here if it was due to the changes in this PR. There are no failing ECC tests though. I am restarting the tests to see if anything changes. If the tests still fail I'll check with the infra team.

@siemen11

Copy link
Copy Markdown
Contributor

Just FYI that the p256 sign also is used in the DICE of the boot, which might be the cause of the failing tests

@h-filali

Copy link
Copy Markdown
Contributor Author

Thanks @siemen11 I just had a look there were some additional instruction count checks I wasn't aware of. I added the updated counts to the commit now. This should hopefully do the trick!

@siemen11

siemen11 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Thanks @h-filali, indeed we now protect the ECC in the boot via instruction counts as well :s sorry for the inconvenience there! Looks like now it is good

@h-filali h-filali added the CI:Rerun Rerun failed CI jobs label Jul 16, 2026
@github-actions github-actions Bot removed the CI:Rerun Rerun failed CI jobs label Jul 16, 2026
@h-filali

h-filali commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

There are two FPGA tests failing. Checking if a rerun does anything. @siemen11 no worries, it wasn't too much of a hassle :)

@siemen11

Copy link
Copy Markdown
Contributor

sca_ibex_python_test_fpga_cw340_sival_rom_ext is a flaky test, so the change looks good to go

This PR first loads randomness into a register before shifting
in 65 bits of the scalar. This acts as an SCA countermeasure.

Signed-off-by: Hakim Filali <hfilali@lowrisc.org>

(cherry picked from commit 3ad70d3)
@siemen11 siemen11 added the CI:Rerun Rerun failed CI jobs label Jul 18, 2026
@github-actions github-actions Bot removed the CI:Rerun Rerun failed CI jobs label Jul 18, 2026
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