deserializer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const BN254_FIELD_ELEMENT_SIZE = 32

in bytes

View Source
const GROTH_16_PROTOCOL_ID = uint32(1)

Variables

This section is empty.

Functions

func ConvertPtauToPhase1

func ConvertPtauToPhase1(ptau Ptau) (phase1 mpcsetup.Phase1, err error)

func WritePhase1FromPtauFile added in v0.1.4

func WritePhase1FromPtauFile(ptauFile *PtauFile, outputPath string) error

Types

type G1

type G1 [2]big.Int

type G2

type G2 [4]big.Int
type Header struct {
	Power         byte
	Contributions uint16
}

func (*Header) ReadFrom

func (p *Header) ReadFrom(reader io.Reader) error

type HeaderGroth

type HeaderGroth struct {
	// contains filtered or unexported fields
}

type NotGroth16

type NotGroth16 struct {
	Err error
}

func (*NotGroth16) Error

func (r *NotGroth16) Error() string

type Ptau

type Ptau struct {
	Header     PtauHeader
	PTauPubKey PtauPubKey
}

func ReadPtau

func ReadPtau(zkeyPath string) (Ptau, error)

type PtauFile added in v0.1.4

type PtauFile struct {
	Header   PtauHeader
	Sections [][]SectionSegment
	Reader   *os.File
}

func InitPtau added in v0.1.4

func InitPtau(path string) (*PtauFile, error)

func (*PtauFile) Close added in v0.1.4

func (ptauFile *PtauFile) Close() error

func (*PtauFile) DomainSize added in v0.1.4

func (ptauFile *PtauFile) DomainSize() int

func (*PtauFile) ReadAlphaTauG1 added in v0.1.4

func (ptauFile *PtauFile) ReadAlphaTauG1(out chan bn254.G1Affine) error

func (*PtauFile) ReadBetaG2 added in v0.1.4

func (ptauFile *PtauFile) ReadBetaG2() (bn254.G2Affine, error)

func (*PtauFile) ReadBetaTauG1 added in v0.1.4

func (ptauFile *PtauFile) ReadBetaTauG1(out chan bn254.G1Affine) error

func (*PtauFile) ReadTauG1 added in v0.1.4

func (ptauFile *PtauFile) ReadTauG1(out chan bn254.G1Affine) error

func (*PtauFile) ReadTauG2 added in v0.1.4

func (ptauFile *PtauFile) ReadTauG2(out chan bn254.G2Affine) error

type PtauHeader

type PtauHeader struct {
	N8    uint32
	Prime big.Int
	Power uint32
}

type PtauPubKey

type PtauPubKey struct {
	TauG1      []G1
	TauG2      []G2
	AlphaTauG1 []G1
	BetaTauG1  []G1
	BetaG2     G2
}

type SectionSegment

type SectionSegment struct {
	// contains filtered or unexported fields
}

type Zkey

type Zkey struct {
	ZkeyHeader ZkeyHeader
	// contains filtered or unexported fields
}

Incomplete (only extracts necessary fields for conversion to .ph1 format)

func ReadZkey

func ReadZkey(zkeyPath string) (Zkey, error)

type ZkeyHeader

type ZkeyHeader struct {
	ProtocolID uint32
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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