Panic on verifying Nil Proof in proof.Verify function
frenkel26 opened this issue · comments
Description
For some zk proofs, when the proof is absent from the message, the verifier panics with nil dereference.
Details
Some proofs implement the Verify function as a pointer receiver, like this:
func (p *Proof) Verify(hash *hash.Hash, ...) bool {
if !p.IsValid() {
return false
}
if p == nil
, then p.IsValid will catch it.
Other proofs implement the Verify function as a value receiver, like this:
func (p Proof) Verify(hash *hash.Hash, ...) bool {
if !p.IsValid() {
return false
}
if p == nil
, the casting will result with nil dereference.