pepper-project / pequin

A system for verifying outsourced computations, and applying SNARKs. Simplified release of the main Pepper codebase.
Other
122 stars 46 forks source link

Adding support for conditional macros #43

Closed fleupold closed 5 years ago

fleupold commented 5 years ago

This change makes it so that conditional macros like:

#define BITS_TO_REPRESENT(n) ((n > 65536) ? 16 : LOG_32768(n))

compile fine, by implementing constant expression evaluation (toInt()) for ConditionalExpression and Binary equivalence operators.

Before, we would run into a compilation error:

I don't know how to coerce ConditionalExpression to a constant.