Documentation ¶
Index ¶
- Constants
- func PowersOf(x fr.Element, degree int) []fr.Element
- func ReadPoint(r io.Reader) (*banderwagon.Element, error)
- func ReadScalar(r io.Reader) (*fr.Element, error)
- type Transcript
- func (t *Transcript) AppendMessage(message []byte, label []byte)
- func (t *Transcript) AppendPoint(point *banderwagon.Element, label []byte)
- func (t *Transcript) AppendScalar(scalar *fr.Element, label []byte)
- func (t *Transcript) ChallengeScalar(label []byte) fr.Element
- func (t *Transcript) DomainSep(label []byte)
Constants ¶
const VectorLength = 256
VectorLength is the number of elements in the vector. This value is fixed. Note that this means that the degree of the polynomial is one less than this value.
Variables ¶
This section is empty.
Functions ¶
func PowersOf ¶
Returns powers of x from 0 to degree-1 <1, x, x^2, x^3, x^4,...,x^(degree-1)> TODO This method is used in two places; one is to evaluate a polynomial (test), and the other is to TODO compute powers of challenges. TODO the first one we can use the bls package for TODO The second we _could_ just multiply on each iteration, (depends on how readable it is)
Types ¶
type Transcript ¶
type Transcript struct {
// contains filtered or unexported fields
}
The transcript is used to create challenge scalars. See: Fiat-Shamir
func NewTranscript ¶
func NewTranscript(label string) *Transcript
func (*Transcript) AppendMessage ¶
func (t *Transcript) AppendMessage(message []byte, label []byte)
func (*Transcript) AppendPoint ¶
func (t *Transcript) AppendPoint(point *banderwagon.Element, label []byte)
Appends a Point to the transcript
Compresses the Point into a 32 byte slice, then appends it to the state
func (*Transcript) AppendScalar ¶
func (t *Transcript) AppendScalar(scalar *fr.Element, label []byte)
Appends a Scalar to the transcript
Converts the scalar to 32 bytes, then appends it to the state
func (*Transcript) ChallengeScalar ¶
func (t *Transcript) ChallengeScalar(label []byte) fr.Element
Computes a challenge based off of the state of the transcript
Hash the transcript state, then reduce the hash modulo the size of the scalar field
Note that calling the transcript twice, will yield two different challenges
func (*Transcript) DomainSep ¶
func (t *Transcript) DomainSep(label []byte)