Skip to content

Optimized sha256 padding code.#9360

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

Optimized sha256 padding code.#9360
orizi merged 1 commit intomainfrom
orizi/12-27-optimized_sha256_padding_code

Conversation

@orizi
Copy link
Collaborator

@orizi orizi commented Dec 27, 2025

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

This change is Reviewable

@orizi orizi mentioned this pull request Dec 27, 2025
5 tasks
Copy link
Collaborator Author

orizi commented Dec 27, 2025

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
Copy link
Collaborator

@TomerStarkware TomerStarkware left a comment

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