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

fix: prevent sha256() from throwing on statically known strings and document potential issues with runtime hashing #907

Merged
merged 10 commits into from
Nov 14, 2024

Conversation

novusnota
Copy link
Member

@novusnota novusnota commented Oct 3, 2024

Issue

Closes #906.

Checklist

  • I have updated CHANGELOG.md
  • I have added tests to demonstrate the contribution is correctly implemented: this usually includes both positive and negative tests, showing the happy path(s) and featuring intentionally broken cases
  • I have run all the tests locally and no test failure was reported
  • I have run the linter, formatter and spellchecker
  • I did not do unrelated and/or undiscussed refactorings

@novusnota novusnota requested a review from a team as a code owner October 3, 2024 01:19
@novusnota novusnota added this to the v1.6.0 milestone Oct 3, 2024
@novusnota novusnota marked this pull request as draft October 21, 2024 14:46
Copy link
Member

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

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

Let's move on with this PR

CHANGELOG.md Outdated Show resolved Hide resolved
src/test/compilation-failed/const-eval-failed.spec.ts Outdated Show resolved Hide resolved
@anton-trunov anton-trunov self-assigned this Nov 6, 2024
@novusnota novusnota changed the title fix: make sha256() throw on comptime strings of length > 128 fix: prevent sha256() from throwing on statically known strings and document potential issues with runtime hashing Nov 12, 2024
@anton-trunov
Copy link
Member

@Gusarich Basically, the fix for the comptime behavior of the sha256 function replicates the H FunC string suffix now

Copy link
Member

@Gusarich Gusarich left a comment

Choose a reason for hiding this comment

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

LGTM overall, just a little note on the comment in tests

src/test/e2e-emulated/intrinsics.spec.ts Outdated Show resolved Hide resolved
@anton-trunov anton-trunov merged commit 387238c into main Nov 14, 2024
18 checks passed
@anton-trunov anton-trunov deleted the closes-906 branch November 14, 2024 18:03
Copy link

@Milad335t Milad335t left a comment

Choose a reason for hiding this comment

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

Milaaaad

Copy link

@Milad335t Milad335t left a comment

Choose a reason for hiding this comment

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

  • Milad...toooon

Copy link

@Milad335t Milad335t left a comment

Choose a reason for hiding this comment

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

  • [x]

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.

sha256 should throw on comptime strings > 128, but it doesn't
5 participants