The checks performed in #749 are well-shaped for being implemented using custom gates and could give significant performance improvement.
As the initial target would be zkevm, then it would also be OK if we only implement the constraint system without the prover/verifier logic.