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

Method AppendBigInt

ecgo/utils/buf.go:21–31  ·  view source on GitHub ↗
(n int, x *big.Int)

Source from the content-addressed store, hash-verified

19}
20
21func (o *OutputBuf) AppendBigInt(n int, x *big.Int) {
22 zbuf := make([]byte, n)
23 b := x.Bytes()
24 if len(b) > n {
25 panic(fmt.Sprintf("big.Int is too large to serialize: %d > %d", len(b), n))
26 }
27 for i := 0; i < len(b); i++ {
28 zbuf[i] = b[len(b)-i-1]
29 }
30 o.buf = append(o.buf, zbuf...)
31}
32
33func (o *OutputBuf) AppendFieldElement(field SimpleField, x constraint.Element) {
34 o.AppendBigInt(field.SerializedLen(), field.ToBigInt(x))

Callers 4

AppendFieldElementMethod · 0.95
SerializeMethod · 0.95
SerializeMethod · 0.95
serializeCoefFunction · 0.80

Calls 1

BytesMethod · 0.80

Tested by

no test coverage detected