Sitelet https://github.com/starkware-libs/cairo/pull/9360
Skip to content

Optimized sha256 padding code. - #9360

Merged
orizi merged 1 commit into
mainfrom
orizi/12-27-optimized_sha256_padding_code
Dec 29, 2025
Merged

orizi merged 1 commit into
mainfrom
orizi/12-27-optimized_sha256_padding_code

Conversation

@orizi

@orizi orizi commented Dec 27, 2025 •

Copy link
Copy Markdown
Collaborator

Summary

Improved performance of sha256 padding phase.

Involved only a single store of the padded value, and using bounded ints for calculation of required values.


Type of change

Please check one:

  • Bug fix (fixes incorrect behavior)
  • New feature
  • Performance improvement
  • Documentation change with concrete technical impact
  • Style, wording, formatting, or typo-only change

Why is this change needed?

Sha256 padding had worse performance than possible.


What was the behavior or documentation before?

Higher gas consumption and larger code.


What is the behavior or documentation after?

Smaller and more efficient code.


@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@orizi orizi mentioned this pull request Dec 27, 2025
1 of 5 tasks

orizi commented Dec 27, 2025 •

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@orizi
orizi force-pushed the orizi/12-27-optimized_sha256_padding_code branch from e32d32c to 2f1c950 Compare December 27, 2025 18:52
@orizi
orizi marked this pull request as ready for review December 27, 2025 22:33

@TomerStarkware TomerStarkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

:lgtm:

@TomerStarkware reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @eytan-starkware).

@orizi
orizi changed the base branch from orizi/12-25-removed_various_todos to graphite-base/9360 December 28, 2025 15:13
@orizi
orizi force-pushed the graphite-base/9360 branch from fe467e0 to f7b306f Compare December 28, 2025 15:13
@orizi
orizi force-pushed the orizi/12-27-optimized_sha256_padding_code branch from 2f1c950 to ff6d810 Compare December 28, 2025 15:13
@orizi
orizi changed the base branch from graphite-base/9360 to main December 28, 2025 15:13
@orizi
orizi added this pull request to the merge queue Dec 29, 2025
Merged via the queue into main with commit 28d9f3d Dec 29, 2025
108 checks passed
@orizi
orizi deleted the orizi/12-27-optimized_sha256_padding_code branch December 29, 2025 09:03
Princetimix69 pushed a commit to Princetimix69/cairo that referenced this pull request Jan 5, 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