Documentation ¶
Overview ¶
Package io offers (de)serialization APIs for gnark objects.
Unstable until v1.X.X release cycle
Index ¶
- func PeekCurveID(file string) (gurvy.ID, error)
- func Read(reader io.Reader, into CurveObject) error
- func ReadFile(path string, into CurveObject) error
- func ReadWitness(path string, into map[string]interface{}) error
- func Write(writer io.Writer, from CurveObject) error
- func WriteFile(path string, from CurveObject) error
- func WriteWitness(path string, from map[string]interface{}) error
- type CurveObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PeekCurveID ¶
PeekCurveID reads the first bytes of the file and tries to decode and return the curveID
func Read ¶
func Read(reader io.Reader, into CurveObject) error
Read reads bytes from reader and construct object into
func ReadFile ¶
func ReadFile(path string, into CurveObject) error
ReadFile read and deserialize input into object provided interface must be a pointer
func ReadWitness ¶
ReadWitness read and deserialize JSON file at path
returned object will contain map[string]interface{}
keys being variable names and interface{} being big.Int
big.Int values in files can be in base10 or base16 strings
func Write ¶
func Write(writer io.Writer, from CurveObject) error
Write object from into provided writer encodes the curveID in the first bytes
func WriteFile ¶
func WriteFile(path string, from CurveObject) error
WriteFile serialize object into file
func WriteWitness ¶
WriteWitness serialize variable map[name]value into file at path
map[string]interface{} --> interface must be convertible to big.Int using backend.FromInterface()
the resulting format is human readable (JSON)
big.Int are serialized in hexadecimal strings
Types ¶
type CurveObject ¶
CurveObject must know which curve they are tied to