Skip to content

How can I write tests that use wrong hint functions? #487

Closed Answered by ivokub
aybehrouz asked this question in Q&A
Discussion options

You must be logged in to vote

Even though a malicious prover could replace hint functions, then I think gnark doesn't provide directly a way to provide incorrect hint function to the prover. We distinguish between hint functions based on id = Hash(Name(hintFn)) where hintFn is a function reference, Name returns fully qualified function name and Hash is some checksum function. So the id of the prover provided hint must be same what compiler has stored for solving some wires.

I think the most fastest option would be to separate hint function behaviour based on some (global) variable. But I think a cleaner solution would be to provide a prover option which allows to provide a hint function with some particular ID.

A hint…

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
8 replies
@aybehrouz
Comment options

@gbotrel
Comment options

@aybehrouz
Comment options

@gbotrel
Comment options

@aybehrouz
Comment options

Answer selected by aybehrouz
Comment options

You must be logged in to vote
4 replies
@aybehrouz
Comment options

@gbotrel
Comment options

@aybehrouz
Comment options

@ivokub
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants