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

Function serializeCoef

ecgo/layered/serialize.go:13–23  ·  view source on GitHub ↗
(o *utils.OutputBuf, bnlen int, coef *big.Int, coefType uint8, publicInputId uint64)

Source from the content-addressed store, hash-verified

11const MAGIC = 3914834606642317635
12
13func serializeCoef(o *utils.OutputBuf, bnlen int, coef *big.Int, coefType uint8, publicInputId uint64) {
14 if coefType == 1 {
15 o.AppendUint8(1)
16 o.AppendBigInt(bnlen, coef)
17 } else if coefType == 2 {
18 o.AppendUint8(2)
19 } else {
20 o.AppendUint8(3)
21 o.AppendUint64(publicInputId)
22 }
23}
24
25func deserializeCoef(in *utils.InputBuf, bnlen int) (*big.Int, uint8, uint64) {
26 coefType := in.ReadUint8()

Callers 1

SerializeMethod · 0.85

Calls 3

AppendUint8Method · 0.80
AppendBigIntMethod · 0.80
AppendUint64Method · 0.80

Tested by

no test coverage detected