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

Function GetFieldId

ecgo/field/field.go:33–44  ·  view source on GitHub ↗
(f Field)

Source from the content-addressed store, hash-verified

31}
32
33func GetFieldId(f Field) uint64 {
34 if f.Field().Cmp(m31.ScalarField) == 0 {
35 return 1
36 }
37 if f.Field().Cmp(bn254.ScalarField) == 0 {
38 return 2
39 }
40 if f.Field().Cmp(gf2.ScalarField) == 0 {
41 return 3
42 }
43 panic(fmt.Sprintf("unsupported field %v", f))
44}
45
46func GetFieldById(id uint64) Field {
47 switch id {

Callers 4

CompileFunction · 0.92
SerializeRootCircuitFunction · 0.92
DetectFieldIdFromFileFunction · 0.92
SerializeRootCircuitFunction · 0.92

Calls 2

CmpMethod · 0.80
FieldMethod · 0.65

Tested by

no test coverage detected