backend

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 11 Imported by: 55

Documentation

Index

Constants

View Source
const OneWire = "ONE_WIRE"

OneWire is the assignment label / name used for the constant wire one

Variables

View Source
var (
	ErrInputNotSet           = errors.New("input not set")
	ErrInputVisiblity        = errors.New("input has incorrect visibility (secret / public)")
	ErrUnsatisfiedConstraint = errors.New("constraint is not satisfied")
	ErrInvalidInputFormat    = errors.New("incorrect input format")
)

Functions

func ErrDuplicateTag

func ErrDuplicateTag(tag string) error

func FromInterface

func FromInterface(i1 interface{}) big.Int

FromInterface converts an interface to a big.Int element

Types

type Assignment

type Assignment struct {
	Value    big.Int
	IsPublic bool // default == false (assignemnt is private)
}

Assignment is used to specify inputs to the Prove and Verify functions

type Assignments

type Assignments map[string]Assignment

Assignments is used to specify inputs to the Prove and Verify functions

func NewAssignment

func NewAssignment() Assignments

NewAssignment returns an empty Assigments object

func (Assignments) Assign

func (a Assignments) Assign(visibility Visibility, name string, v interface{})

Assign assign a value to a Secret/Public input identified by its name

func (Assignments) DiscardSecrets

func (assignments Assignments) DiscardSecrets() Assignments

DiscardSecrets returns a copy of self without Secret Assigment

func (Assignments) Read

func (assigment Assignments) Read(r io.Reader) error

Read parse r1cs.Assigments from given io.Reader

func (Assignments) ReadFile

func (assignment Assignments) ReadFile(filePath string) error

ReadFile parse r1cs.Assigments from given file

func (Assignments) Write

func (assignment Assignments) Write(w io.Writer) error

Write serialize given assigment to io.Writer

func (Assignments) WriteFile

func (assignment Assignments) WriteFile(path string) error

WriteFile serialize given assigment to disk

type Visibility

type Visibility string

Visibility type alias on string to define circuit input's visibility

const (
	Secret Visibility = "secret"
	Public Visibility = "public"
)

Possible Visibility attributes for circuit inputs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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