ginger-lib icon indicating copy to clipboard operation
ginger-lib copied to clipboard

Import macro-generated UInt gadgets from arkworks

Open 95DDB opened this issue 4 years ago • 0 comments

arkworks generates the UInt gadget (from Uint16 up to UInt128) using macros (as the code is basically the same):

https://github.com/arkworks-rs/r1cs-std/blob/master/src/bits/uint.rs

Let us adopt the same procedure, and let's define and implement for them also AllocGadget, ToBitsGadget and FromBitsGadget (currently these functions already exist, but they are not put in what would be the correct corresponding trait, making the calling code a bit confusional and not standard in terms of traits to be used). Let's implement this traits (if not already) also for UInt8 and Boolean gadgets (that must be excluded, like arkworks, from the macro generation procedure)

95DDB avatar Dec 22 '21 10:12 95DDB