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 calcwit.cpp InputHashMap wrap-around #239

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blukat29
Copy link

@blukat29 blukat29 commented Feb 6, 2024

The witness calculated generated with circom --cpp may not work depending on the input signal names.

In the calcwit.cpp, if the signal name hash h happens to satisfy pos = (h % 256) = get_size_of_input_hashmap() - 1 and there is a hashmap collision, then the loop fails to find the InputHashMap entry.

In our case (found by @2dvorak) the two signals were hashed to the pos = 255. "expLen" (h = 13708731413403068927) and "audValOffset" (h = 16744535348853068031).

This PR fixes the edge case.

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.

1 participant