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

Feature: compute program hash chain #1647

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

odesenfans
Copy link
Contributor

@odesenfans odesenfans commented Mar 5, 2024

Problem: computing the hash of a program is useful to verify its integrity. This hash is also used for different purposes, like when loading a program with the bootloader.

Solution: add a program_hash module and the
compute_program_hash_chain function that computes the hash of a stripped program, making it usable with Program and CairoPie objects.

Description of the pull request changes and motivation.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

@odesenfans
Copy link
Contributor Author

Some more backporting from the bootloader hints. This new module allows to get the hash of a program to replace the functionality of the cairo-hash-program command. I'm integrating that feature in the new Stone CLI and I thought it made sense to integrate it here. Let me know what you think!

vm/src/lib.rs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

Attention: Patch coverage is 96.73913% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 96.71%. Comparing base (105ca3a) to head (09e4be2).

Files Patch % Lines
vm/src/program_hash.rs 96.73% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1647      +/-   ##
==========================================
+ Coverage   96.70%   96.71%   +0.01%     
==========================================
  Files          95       96       +1     
  Lines       38154    38246      +92     
==========================================
+ Hits        36897    36990      +93     
+ Misses       1257     1256       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@odesenfans odesenfans force-pushed the msl/program-hash-chain branch from cdb2b59 to 1684d17 Compare March 7, 2024 12:28
Problem: computing the hash of a program is useful to verify its
integrity. This hash is also used for different purposes, like when
loading a program with the bootloader.

Solution: add a `program_hash` module and the
`compute_program_hash_chain` function that computes the hash of a
stripped program, making it usable with `Program` and `CairoPie`
objects.
@odesenfans odesenfans force-pushed the msl/program-hash-chain branch from 1684d17 to 09e4be2 Compare March 10, 2024 21:36
@odesenfans
Copy link
Contributor Author

This PR seems ready for merging, can anyone give it the second approval? @Oppen @juanbono

@juanbono juanbono added this pull request to the merge queue Apr 5, 2024
Merged via the queue into lambdaclass:main with commit c692b75 Apr 5, 2024
51 of 52 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