core

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PRNG

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

PRNG defines a psuedorandom number generator

func (*PRNG) Next

func (prng *PRNG) Next() *ristretto.Scalar

Next returns the next "random" scalar from the PRNG

type Transcript

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

Transcript provides a consistent transcript primitive for our protocols

We have the following goals:

  • Allow sequential proofs over a common transcript (ensuring a single proof cannot be extracted standalone)
  • be able to produce a human-readable transcript for auditing.

The design of this API was inspired by Merlin: https://docs.rs/crate/merlin/

func NewTranscript

func NewTranscript(label string) *Transcript

NewTranscript creates a new Transcript with the given Label, the label should be unique to the application

func (*Transcript) AddElementToTranscript

func (t *Transcript) AddElementToTranscript(label string, element *ristretto.Element)

AddElementToTranscript appends a value to the transcript with the given label This binds the given data to the label.

func (*Transcript) AddToTranscript

func (t *Transcript) AddToTranscript(label string, b []byte)

AddToTranscript appends a value to the transcript with the given label This binds the given data to the label.

func (*Transcript) CommitToGenerator

func (t *Transcript) CommitToGenerator(label string) *ristretto.Element

CommitToGenerator derives a verifiably random generator from the transcript

func (*Transcript) CommitToGenerators

func (t *Transcript) CommitToGenerators(label string, n int) (generators []*ristretto.Element)

CommitToGenerators derives a set of verifiably random generators from the transcript

func (*Transcript) CommitToPRNG

func (t *Transcript) CommitToPRNG(label string) PRNG

CommitToPRNG commits the label to the transcript and derives a PRNG from the transcript.

func (*Transcript) CommitToTranscript

func (t *Transcript) CommitToTranscript(label string) []byte

CommitToTranscript generates a challenge based on the current transcript, it also commits the challenge to the transcript.

func (*Transcript) CommitToTranscriptScalar

func (t *Transcript) CommitToTranscriptScalar(label string) *ristretto.Scalar

CommitToTranscriptScalar is a convenience method for CommitToTranscript which returns a ristretto Scalar

func (*Transcript) NewProtocol

func (t *Transcript) NewProtocol(label string)

NewProtocol provides explicit protocol separation in a transcript (more readable audit scripts and even more explicit binding of committed values to a given context)

func (Transcript) OutputTranscriptToAudit

func (t Transcript) OutputTranscriptToAudit() string

OutputTranscriptToAudit outputs a human-readable copy of the transcript so far.

Jump to

Keyboard shortcuts

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