MCPcopy Create free account
hub / github.com/PolyhedraZK/ExpanderCompilerCollection / NewVar

Function NewVar

ecgo/utils/gnarkexpr/expr.go:28–38  ·  view source on GitHub ↗
(x int)

Source from the content-addressed store, hash-verified

26const MaxVariables = (1 << 31) - 100
27
28func NewVar(x int) Expr {
29 if x < 0 || x >= MaxVariables {
30 panic("variable id out of range")
31 }
32 v := builder.InternalVariable(uint32(x))
33 t := reflect.ValueOf(v).Index(0).Interface().(Expr)
34 if t.WireID() != x {
35 panic("variable id mismatch, please check gnark version")
36 }
37 return t
38}

Callers 1

newVariableFunction · 0.92

Calls 2

InternalVariableMethod · 0.80
WireIDMethod · 0.80

Tested by

no test coverage detected