Consensys / corset

4 stars 12 forks source link

Document warning on `and!`, `or`, `all!`, `any` #76

Closed DavePearce closed 2 months ago

DavePearce commented 2 months ago

These functions accept variadic arguments, and place requirements on them. Specifically, that summing any two arguments cannot result in 0 unless they are all 0. In real terms, this means they should be "small" in some sense (e.g. u1, u8, etc). Unfortunately, the lack of type information given for the arguments of this functions represents a potential pitfall. Specifically:

The latter point is especially true with field agnosticity. That's because the size of fields (hence the chance of overflow) is much increased.