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

feat: expose sha256 helper functions #6214

Closed
wants to merge 1 commit into from
Closed

Conversation

saleel
Copy link
Contributor

@saleel saleel commented Oct 3, 2024

Description

Expose sha256 internal methods

Problem*

Expose these functions so they could be used for partial-sha256 implementation (by Mach34/zkemail.nr). Currently these methods are copy/pasted.

Summary*

Make below functions public:

  • verify_msg_block
  • build_msg_block_iter
  • msg_u8_to_u32
  • pad_msg_block
  • attach_len_to_msg_block
  • hash_final_block

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Member

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

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

Internal methods are internal on purpose for reasons set out in #1258

The more stuff we expose through the stdlib, the harder it is to make non breaking changes. Copy-pasting this code is fine.

@saleel
Copy link
Contributor Author

saleel commented Oct 3, 2024

The more stuff we expose through the stdlib, the harder it is to make non breaking changes.

True. Closing.

@saleel saleel closed this Oct 3, 2024
@saleel saleel deleted the saleel/sha256-pub-methods branch October 3, 2024 06:52
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.

2 participants