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

Add foreign Keccak256 function that accepts variable message size at prover time #1399

Closed
1 task done
Tracked by #19
Savio-Sou opened this issue May 25, 2023 · 0 comments · Fixed by #1481
Closed
1 task done
Tracked by #19

Add foreign Keccak256 function that accepts variable message size at prover time #1399

Savio-Sou opened this issue May 25, 2023 · 0 comments · Fixed by #1481
Assignees
Labels
enhancement New feature or request

Comments

@Savio-Sou
Copy link
Collaborator

Savio-Sou commented May 25, 2023

Problem

Followup of noir-lang/acvm#313.

Supporting variable-sized input to the hash function is useful for e.g. Ethereum storage proofs.

Happy Case

let message_size = 4;
let hash_a = std::hash::keccak256([1,2,3,4], message_size);
let hash_b = std::hash::keccak256([1,2,3,4,0,0,0,0], message_size);

assert hash_a == hash_b;

let message_size_big = 8;
let hash_c = std::hash::keccak256([1,2,3,4,0,0,0,0], message_size_big);

assert hash_a != hash_c;

Additional Context

Blocked by

Preview Give feedback
  1. 7 of 7

Would you like to submit a PR for this Issue?

No

@Savio-Sou Savio-Sou added the enhancement New feature or request label May 25, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir May 25, 2023
@Savio-Sou Savio-Sou moved this from 📋 Backlog to 🚧 Blocked in Noir May 31, 2023
@Savio-Sou Savio-Sou linked a pull request Jun 2, 2023 that will close this issue
5 tasks
@github-project-automation github-project-automation bot moved this from 🚧 Blocked to ✅ Done in Noir Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants