io

package
v0.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 7 Imported by: 11

Documentation

Overview

Package io offers useful serialization interfaces for gnark objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadWitness

func ReadWitness(reader io.Reader, into map[string]interface{}) error

ReadWitness read and deserialize JSON file from reader

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 WriteWitness

func WriteWitness(writer io.Writer, from map[string]interface{}) error

WriteWitness serialize variable map[name]value into writer

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 WriterRawTo added in v0.3.6

type WriterRawTo interface {
	WriteRawTo(w io.Writer) (n int64, err error)
}

WriterRawTo is the interface that wraps the WriteRawTo method.

WriteRawTo writes data to w until there's no more data to write or when an error occurs. The return value n is the number of bytes written. Any error encountered during the write is also returned.

WriteRawTo will not compress the data (as opposed to WriteTo)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL