-
Notifications
You must be signed in to change notification settings - Fork 225
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
chore: Add hash_to_field
Noir alternative
#3338
Conversation
tooling/nargo_cli/tests/execution_success/hash_to_field/src/main.nr
Outdated
Show resolved
Hide resolved
Changes to circuit sizes
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
I think a 10% slowdown is okay in exchange for one less ACIR opcode and we can optimize bytes32_to_field in the future by finding out the diff between the Noir algorithm and the bb algorithm. EDIT: My mistake, the benchmark is 10% more because we modified the tests |
Most likely due to it using a slice for the byte decomposition. This adds a bunch of costs when it comes to turning it back into a |
Description
Related to noir-lang/acvm#358
This only adds a test to show that we can implement the hash_to_field blackbox function in Noir.
Since hash_to_field takes Field elements as parameters, the decomposition shown is needed to hash a ~254 bit element instead of a single u8.
Problem*
Resolves
Summary*
Additional Context
Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.