arkworks-rs / r1cs-std

R1CS constraints for bits, fields, and elliptic curves
https://www.arkworks.rs
Apache License 2.0
133 stars 58 forks source link

nonnative arithmetic doesn't support < 3 limbs configuration #128

Open slumber opened 1 year ago

slumber commented 1 year ago

The following code panics if you attempt to use configuration with 1 or 2 limbs

https://github.com/arkworks-rs/r1cs-std/blob/2ca3bd7d97ac2674a09fed63ace16b4f181531b1/src/fields/nonnative/reduce.rs#L170-L174

However, I don't remember bellman-bignat having this limitation

https://github.com/arkworks-rs/r1cs-std/blob/2ca3bd7d97ac2674a09fed63ace16b4f181531b1/src/fields/nonnative/reduce.rs#L276

This could be a problem if nonnative params become configurable