Documentation
¶
Index ¶
- type PRNG
- type Transcript
- func (t *Transcript) AddElementToTranscript(label string, element *ristretto.Element)
- func (t *Transcript) AddToTranscript(label string, b []byte)
- func (t *Transcript) CommitToGenerator(label string) *ristretto.Element
- func (t *Transcript) CommitToGenerators(label string, n int) (generators []*ristretto.Element)
- func (t *Transcript) CommitToPRNG(label string) PRNG
- func (t *Transcript) CommitToTranscript(label string) []byte
- func (t *Transcript) CommitToTranscriptScalar(label string) *ristretto.Scalar
- func (t *Transcript) NewProtocol(label string)
- func (t Transcript) OutputTranscriptToAudit() string
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
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.