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

Update to rust 1.84 #1956

Merged
merged 4 commits into from
Feb 27, 2025
Merged

Update to rust 1.84 #1956

merged 4 commits into from
Feb 27, 2025

Conversation

ArthurHeymans
Copy link
Contributor

The reason for doing this is to be able to generate templates using rustcrypto which already supports ML-DSA87 (needs 1.81).
This PR fixes all the warnings and errors that the new toolchain brings.
Stack usage is increase by 4K with this newer version

swenson
swenson previously approved these changes Feb 10, 2025
Copy link
Contributor

@swenson swenson left a comment

Choose a reason for hiding this comment

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

LGTM, a couple of nits.

This will also unblock us using the Caliptra image builder in the MCU so we can do full integration tests with both emulators.

@mhatrevi mhatrevi added the Caliptra v2.0 Items to be considered for v2.0 Release label Feb 12, 2025
@ArthurHeymans
Copy link
Contributor Author

It fails formatting on DPE. Main branch of DPE seems to have that fixed, however it would require chipsalliance/caliptra-dpe#388 to be cherry-picked

@ArthurHeymans ArthurHeymans force-pushed the rust-1.84 branch 2 times, most recently from 667454b to 39cdca2 Compare February 21, 2025 15:49
@ArthurHeymans
Copy link
Contributor Author

So the ubuntu 20.04 linker seems to have problems with the libcaliptra.a and fails to find some symbols. This does not happen on my local machine. Trying out more recent images in CI (20.04 is deprecated soon anyway)

swenson
swenson previously approved these changes Feb 22, 2025
Copy link
Contributor

@swenson swenson left a comment

Choose a reason for hiding this comment

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

LGTM

@swenson
Copy link
Contributor

swenson commented Feb 22, 2025

@ArthurHeymans The symbols dropping appear to be due to them only accidentally being included in the first place -- they weren't actually defined except in test modes. I'm not sure how the code ever compiled. So, I added those symbols into the C code properly.

I also fixed an additional problem where the Go code was passing in a nil slice with 0 length, which was previously allowed but now panics.

swenson
swenson previously approved these changes Feb 25, 2025
ArthurHeymans and others added 4 commits February 27, 2025 10:45
This fixes all the warnings and erros that the newer rust toolchain
throws.

1.84 uses a bit more stack than 1.70.

Signed-off-by: Arthur Heymans <arthur.heymans@9elements.com>
It looks like linker has problems. Maybe updating fixes it?

Signed-off-by: Arthur Heymans <arthur.heymans@9elements.com>
caliptra_model.h is not a file. Update the target to be an actual file.

Signed-off-by: Arthur Heymans <arthur.heymans@9elements.com>
Frankly, I don't know how the code was compiling before, but I suppose
Rust must have either accidentally left the symbols in the `.a` file?

Also we need to pass non-nil ICCM and DCCM pointers in Go code to Rust,
as Rust now will panic if nil slices are constructed, even if they have
length 0.
@mhatrevi mhatrevi merged commit aec9434 into main-2.x Feb 27, 2025
5 checks passed
@swenson swenson deleted the rust-1.84 branch February 27, 2025 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Caliptra v2.0 Items to be considered for v2.0 Release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants