zcash / halo2

The Halo2 zero-knowledge proving system
https://zcash.github.io/halo2/
Other
712 stars 487 forks source link

Add a LookupRangeCheck trait and minor modifications in preparation for ZSA #823

Open ConstanceBeguier opened 1 month ago

ConstanceBeguier commented 1 month ago

This PR contains the following modifications:

  1. Introduce a LookupRangeCheck trait that provides common methods for a lookup range check.
  2. Use this new trait as a generic parameter in configs, chips and tests that are using lookup.
  3. Add tests for Lookup, ECC, Merkle, and Sinsemilla to verify that the verification key and the proof have not been modified by comparing them to those saved in a file.
  4. Add the EccPointQ enum to handle public and private points for Q, which is the initialization point for the hashing function.

To adjust existing code to these modifications, developers will just need to import halo2_gadgets::utilities::lookup_range_check::LookupRangeCheck. This Orchard PR demonstrates how to adapt the Orchard code.