fiatshamir

package
v0.0.0-...-e663500 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashToPrime

func HashToPrime(input []string, length ChallengeLength) *big.Int

HashToPrime takes the input into Poseidon and take the hash output to input repeatedly until we hit a prime number length of challenge is based on the input length. Default is 256-bit.

Types

type ChallengeLength

type ChallengeLength uint32

ChallengeLength denotes the maximum length of challenge

const (

	// Default lenght is 256-bit
	Default ChallengeLength = iota
	// Max252 lenght is 252-bit
	Max252
)

type Transcript

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

Transcript strores the statement to generate challenge in the info as a slice of strings

func InitTranscript

func InitTranscript(input []string, length ChallengeLength) *Transcript

InitTranscript inits a transcript with the input strings

func (*Transcript) Append

func (transcript *Transcript) Append(newInfo string)

Append add new info into the transcript

func (*Transcript) AppendSlice

func (transcript *Transcript) AppendSlice(newInfo []string)

AppendSlice add new slice info into the transcript

func (*Transcript) GetChallengeAndAppendTranscript

func (transcript *Transcript) GetChallengeAndAppendTranscript() *big.Int

GetChallengeAndAppendTranscript returns a challenge and appends the challenge as part of the transcript

func (*Transcript) Print

func (transcript *Transcript) Print()

Print outputs the info in the transcript

Jump to

Keyboard shortcuts

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