(n int, x *big.Int)
| 19 | } |
| 20 | |
| 21 | func (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 | |
| 33 | func (o *OutputBuf) AppendFieldElement(field SimpleField, x constraint.Element) { |
| 34 | o.AppendBigInt(field.SerializedLen(), field.ToBigInt(x)) |
no test coverage detected