Skip to content
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

[sival/cryptotest] Cherry-pick cryptotest commits to earlgrey_es_sival #21375

Merged

Conversation

RyanTorok
Copy link
Contributor

@RyanTorok RyanTorok commented Feb 14, 2024

Cherry-picks the set of cryptotest commits currently in master to earlgrey_es_sival, including the commit from #21112, which originally received a merge conflict on earlgrey_es_sival. Future cryptotest PRs will be automatically flagged to be cherry-picked to earlgrey_es_sival using the GitHub tag.

@RyanTorok RyanTorok requested review from cfrantz and a team as code owners February 14, 2024 20:19
@RyanTorok RyanTorok requested review from timothytrippel and milesdai and removed request for a team February 14, 2024 20:19
@milesdai
Copy link
Contributor

@moidx Just confirming that we want to be cherry-picking the cryptotest work onto the sival branch.

@RyanTorok
Copy link
Contributor Author

Added the commit from #21114 to this PR because it also gets a merge conflict when applied directly onto earlgrey_es_sival.

@moidx
Copy link
Contributor

moidx commented Feb 17, 2024

@moidx Just confirming that we want to be cherry-picking the cryptotest work onto the sival branch.

Yes, please!

@RyanTorok RyanTorok force-pushed the earlgrey-cherry-pick-cryptotests branch from 7fe11f6 to ad2ba34 Compare February 20, 2024 22:20
@RyanTorok RyanTorok requested a review from a team as a code owner February 20, 2024 22:20
@RyanTorok RyanTorok requested review from jon-flatley and removed request for a team February 20, 2024 22:20
@RyanTorok RyanTorok force-pushed the earlgrey-cherry-pick-cryptotests branch from ad2ba34 to 03d1516 Compare February 21, 2024 14:51
@RyanTorok
Copy link
Contributor Author

Hopefully fixed the CI build, which required cherry-picking a few missing commits from cryptolib and adding a new commit to add a couple of the cryptotest binaries to the pen-test cryptotest firmware, which is local to this branch.

@@ -176,6 +199,7 @@ opentitan_test(
deps = [
":aes",
":aes_sca",
":hash",
Copy link
Contributor Author

@RyanTorok RyanTorok Feb 21, 2024

Choose a reason for hiding this comment

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

Needing to add the firmware handlers for each algorithm here is necessary for the build to pass CI, and we cannot replicate this change when merging to master because the chip_pen_test build is local to this branch. Unfortunately, this means that we cannot automatically cherry-pick future cryptotest PRs to the earlgrey_es_sival branch. This will require a PR every time, or at least another glob PR like this one.

jadephilipoom and others added 9 commits February 21, 2024 16:05
Signed-off-by: Jade Philipoom <jadep@google.com>
After moving the CRC32 library out of `silicon_creator`, replace
references to it with the new location and fix include guards and BUILD
files.

Signed-off-by: Jade Philipoom <jadep@google.com>
The implementation here is very similar to RSA-2K.

Signed-off-by: Jade Philipoom <jadep@google.com>
Signed-off-by: Jade Philipoom <jadep@google.com>
Since word/byte buffers are structs containing only a pointer and a
length, there is no need to make them pointers when they are return
values, and this makes the API a little more ergonomic.

Signed-off-by: Jade Philipoom <jadep@google.com>
This is helpful for compatibility when the cryptolib is called from Rust
code.

Signed-off-by: Jade Philipoom <jadep@google.com>
Signed-off-by: Jade Philipoom <jadep@google.com>
Now that the output buffer is passed by value, the length must be
returned separately.

Signed-off-by: Jade Philipoom <jadep@google.com>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
RyanTorok and others added 26 commits February 21, 2024 16:11
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
…nd run python formatter

The qx, qy, r, and s paramters were changed from integers to strings to
prevent serde_json from truncating the value to a 64-bit floating point
number. Instead, the Rust test harness is now responsible for parsing
the hex string into the full-precision value.

Signed-off-by: Ryan Torok <rtorok@opentitan.org>
…ters

A few tests in the wycheproof test vectors included oversized r/s parameters
that statically cannot be passed to cryptolib, so they are excluded from
the test harness.

Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Miles Dai <milesdai@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
The bug occurs when a customization string (or function name)
exceeds 32-bytes. In this case, the encoding of the string size
requires more than 1 bytes, and the ordering between 2 bytes
become relevant.

This commit fixes the bug where the ordering was previously
incorrect.

Signed-off-by: Fatih Balli <fatihballi@google.com>
Extend KMAC driver so that it supports sideloading
the key from Keymgr.

Signed-off-by: Fatih Balli <fatihballi@google.com>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
Signed-off-by: Ryan Torok <rtorok@opentitan.org>
@RyanTorok RyanTorok force-pushed the earlgrey-cherry-pick-cryptotests branch from 03d1516 to f06f668 Compare February 21, 2024 16:45
@milesdai milesdai merged commit eecd9b7 into lowRISC:earlgrey_es_sival Feb 23, 2024
29 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.

None yet

6 participants