circom-compat
circom-compat copied to clipboard
Cleanly separate Circom1 and Circom2 traits
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 toCircom1
for consistency and to make it easier to explain this work. - When creating a
WitnessCalculator
object, we don't use theSafeMemory
object for theCircom2
trait methods and iiuc it won't even work in this case. This field should be optional and take a value ofNone
for the circom2 case. - Move
ptr
based methods fromCircomBase
toCircom1
, as they are not useful in theCircom2
case. - move shared functions
get_version
andget_u32
toCircomBase
- remove the unused function
get_witness_buffer