circom-compat icon indicating copy to clipboard operation
circom-compat copied to clipboard

Cleanly separate Circom1 and Circom2 traits

Open martyall opened this issue 10 months ago • 0 comments

I was working on upgrading the libraries here to use more recent versions of wasmer -- I have tests passing for the most recent versions 4.2.*. In the process I noticed that the separation between CircomBase Circom and Circom2 traits wasn't as clean as it could be, and in fact this was affecting the project I was working on. These should all be non-breaking changes:

  • Rename Circom trait to Circom1 for consistency and to make it easier to explain this work.
  • When creating a WitnessCalculator object, we don't use the SafeMemory object for the Circom2 trait methods and iiuc it won't even work in this case. This field should be optional and take a value of None for the circom2 case.
  • Move ptr based methods from CircomBase to Circom1, as they are not useful in the Circom2 case.
  • move shared functions get_version and get_u32 to CircomBase
  • remove the unused function get_witness_buffer

martyall avatar Apr 16 '24 17:04 martyall