Skip to content

Inquiry Regarding Implementation of the EdDSA Gadget in Circuit Design #1098

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

You must be logged in to vote

You are right - this obvious compression would indeed allow to find several inputs which "hash" to the same frontend.Variable. A solution is to use a more secure hash function - either a binary hash (a la sha2/keccak) or algebraic hash (MiMC, Poseidon etc.). But keep in mind that algebraic hashes takes as inputs also frontend.Variable so you should split your long certificates into smaller chunks (32 bytes etc depending on the scalar field).

With binary hash it is a little simpler (as it is quite similar to what is done natively without ZKs), see https://github.com/ritave/eIDAS-bridge/blob/main/snark/circuits/circuit.go#L149-L170 for the in-circuit implementation and https://github.com/ri…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@AhmedElemary57
Comment options

@ivokub
Comment options

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