I am interested in the practicality of using generic SNARK techniques to prove the following relation.
Let E
and E'
be two ElGamal ciphertexts. They have the form
E = (E1, E2) = (g^r, M*PK^r)
and E' = (E1', E2') = (g^r', M'*PK^r')
.
There is also a hash function H
.
All of these are public: E
, E'
, PK
, H
.
I want to prove that M' = H(M)
. I do not hold the secret key associated with the public key PK
, but I do know the randoms r
and r'
that were used for the encryptions.
In particular, my witness is (r,r')
and the SNARK verification circuit will:
- Use
PK
,r
, andE2
to decryptM
. - Use
PK
,r'
, andE2'
to decryptM'
. - Output accept iff
M' = H(M)
.
My questions are:
- Can someone provide a rough intuition for how practical proving this statement will be? I am more sensitive to verification time and proof size than I am to prover time.
- Are there any hash functions that are particularly well-suited for this kind of task? (I have heard of the existence of Poseidon, but there seem to be a few SNARK friendly hash functions and I haven't yet gotten to the bottom of how they compare.)
Many thanks