Documentation
¶
Overview ¶
Package io offers (de)serialization APIs for gnark objects consider it unstable until v1.X.X release cycle
Index ¶
- func PeekCurveID(file string) (gurvy.ID, error)
- func Read(reader io.Reader, into CurveSpecific) error
- func ReadFile(path string, into CurveSpecific) error
- func ReadWitness(path string, into map[string]interface{}) error
- func Write(writer io.Writer, from CurveSpecific) error
- func WriteFile(path string, from CurveSpecific) error
- func WriteWitness(path string, from map[string]interface{}) error
- type CurveSpecific
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 CurveSpecific) error
Read reads bytes from reader and construct object into
func ReadFile ¶
func ReadFile(path string, into CurveSpecific) 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 CurveSpecific) error
Write object from into provided writer encodes the curveID in the first bytes
func WriteFile ¶
func WriteFile(path string, from CurveSpecific) 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 CurveSpecific ¶
CurveSpecific objects must know which curve they are tied to