aztec-nr - std

Function verify_proof_with_type

pub fn verify_proof_with_type<let N: u32, let M: u32, let K: u32>(
    verification_key: [Field; N],
    proof: [Field; M],
    public_inputs: [Field; K],
    key_hash: Field,
    proof_type: u32,
)

Asserts the validity of the provided proof and public inputs against the provided verification key and hash.

The ACVM cannot determine whether the provided proof is valid during execution as this requires knowledge of the backend against which the program is being proven. However if an invalid proof if submitted, the program may fail to prove or the backend may generate a proof which will subsequently fail to verify.

Important Note

If you are not developing your own backend such as Barretenberg you probably shouldn't need to interact with this function directly. It's easier and safer to use a verification library which is published by the developers of the backend which will document or enforce any safety requirements.

If you use this directly, you're liable to introduce underconstrainedness bugs and your circuit will be insecure.

Arguments

Constraining key_hash

The Noir compiler does not by itself constrain that key_hash is a valid hash of verification_key. This is because different backends may differ in how they hash their verification keys. It is then the responsibility of either the noir developer (by explicitly hashing the verification key in the correct manner) or by the proving system itself internally asserting the correctness of key_hash.