Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayString(dimension []int64) string
- func ArrayStringBuild(in []int64, res string, coll *[]string)
- func CalculateTrace(r1cs *R1CS, input []InputArgument) (witness []*big.Int, err error)
- func NewCircuit(name string, context *function) *function
- type Client
- type Gate
- type Hub
- type InputArgument
- type Lexer
- func (l *Lexer) Current() string
- func (l *Lexer) Emit(t TokenType)
- func (l *Lexer) Error(e string)
- func (l *Lexer) Ignore()
- func (l *Lexer) Next() rune
- func (l *Lexer) NextToken() (*Token, bool)
- func (l *Lexer) Peek() rune
- func (l *Lexer) PeekTwo() string
- func (l *Lexer) Rewind()
- func (l *Lexer) Start()
- func (l *Lexer) StartSync()
- func (l *Lexer) Take(chars string)
- type MultiplicationGateSignature
- type Parser
- func (p *Parser) Assert(in string, tok Token)
- func (p *Parser) AssertIdentifiedType(typ TokenType, tok Token)
- func (p *Parser) AssertIdentifier(token Token)
- func (p *Parser) AssertTypes(toks []Token, types ...TokenType)
- func (p *Parser) PreCompile(currentCircuit *function, tokens []Token)
- func (p *Parser) PrepareFunctionSignature(newFunction *function, stack []Token)
- type Program
- type R1CS
- type R1CSSparse
- type R1CSTransposed
- type R1CSsPARSETransposed
- type StateFunc
- type Task
- type Token
- type TokenType
- type Tokens
Constants ¶
const (
EOFRune rune = -1
)
Variables ¶
var IN = IDENTIFIER_VARIABLE | ARGUMENT | VARIABLE_DECLARE | UNASIGNEDVAR
Functions ¶
func ArrayString ¶
func ArrayStringBuild ¶
outdated.. delete soon
func CalculateTrace ¶
func CalculateTrace(r1cs *R1CS, input []InputArgument) (witness []*big.Int, err error)
func NewCircuit ¶
func NewCircuit(name string, context *function) *function
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a middleman between the websocket connection and the hub.
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to the clients.
func StartServer ¶
type InputArgument ¶
type InputArgument struct {
// contains filtered or unexported fields
}
func CombineInputs ¶
func CombineInputs(abstract []string, concrete []*big.Int) (res []InputArgument)
func (InputArgument) String ¶
func (in InputArgument) String() string
type Lexer ¶
type Lexer struct { Err error ErrorHandler func(e string) // contains filtered or unexported fields }
func (*Lexer) Emit ¶
Emit will receive a token type and push a new token with the current analyzed value into the tokens channel.
func (*Lexer) Ignore ¶
func (l *Lexer) Ignore()
Ignore clears the rewind stack and then sets the current beginning position to the current position in the source which effectively ignores the section of the source being analyzed.
func (*Lexer) Next ¶
Next pulls the next rune from the Lexer and returns it, moving the position forward in the source.
func (*Lexer) NextToken ¶
nextToken returns the next token from the lexer and a value to denote whether or not the token is finished.
func (*Lexer) Peek ¶
Peek performs a Next operation immediately followed by a Rewind returning the peeked rune.
func (*Lexer) PeekTwo ¶
Peek performs a Next operation immediately followed by a Rewind returning the peeked rune.
func (*Lexer) Rewind ¶
func (l *Lexer) Rewind()
Rewind will take the last rune read (if any) and rewind back. Rewinds can occur more than once per call to Next but you can never rewind past the last point a token was emitted.
type MultiplicationGateSignature ¶
type MultiplicationGateSignature struct {
// contains filtered or unexported fields
}
type Parser ¶
type Parser struct { ErrorHandler func(e string) Err error // contains filtered or unexported fields }
func (*Parser) AssertIdentifiedType ¶
func (*Parser) AssertIdentifier ¶
func (*Parser) AssertTypes ¶
func (*Parser) PreCompile ¶
func (*Parser) PrepareFunctionSignature ¶
type Program ¶
type Program struct { PublicInputs []string // contains filtered or unexported fields }
func (*Program) Execute ¶
func (p *Program) Execute() (orderedmGates *gateContainer)
Execute runs on a program and returns a precursor for the final R1CS description
func (*Program) GatesToR1CS ¶
GenerateR1CS generates the R1CS Language from an array of gates
func (*Program) GetMainCircuit ¶
func (p *Program) GetMainCircuit() *function
func (*Program) GlobalInputCount ¶
returns the cardinality of all public inputs (+ 1 for the "one" signal)
type R1CS ¶
type R1CS struct {
WitnessLength, NumberOfGates int
L []utils.Poly
R []utils.Poly
O []utils.Poly
// contains filtered or unexported fields
}
func (*R1CS) Transpose ¶
func (er1cs *R1CS) Transpose() (transposed *R1CSTransposed)
type R1CSSparse ¶
type R1CSSparse struct {
WitnessLength, NumberOfGates int
L []*utils.AvlTree
R []*utils.AvlTree
O []*utils.AvlTree
// contains filtered or unexported fields
}
func (*R1CSSparse) TransposeSparse ¶
func (er1cs *R1CSSparse) TransposeSparse() (transposed *R1CSsPARSETransposed)
type R1CSTransposed ¶
type R1CSTransposed struct {
WitnessLength, NumberOfGates int
L []utils.Poly
R []utils.Poly
O []utils.Poly
// contains filtered or unexported fields
}
func (*R1CSTransposed) R1CSToEAP_FFT ¶
func (er1cs *R1CSTransposed) R1CSToEAP_FFT(fft *utils.FFT_PrecomputedParas, pf *utils.PolynomialField, tau *big.Int) (Ai_Tau, Ri_Tau, Oi_Tau []*big.Int)
type R1CSsPARSETransposed ¶
type StateFunc ¶
func DecimalNumberState ¶
func HexNumberState ¶
func IdentState ¶
func ProbablyWhitespaceState ¶
func WhitespaceState ¶
type Token ¶
func (Token) CopyAndSetMultiplicative ¶
type TokenType ¶
type TokenType int
const ( DecimalNumberToken TokenType = 1 << iota HexNumberToken SyntaxToken CommentToken AssignmentOperatorToken ArithmeticOperatorToken BooleanOperatorToken BitOperatorToken BinaryComperatorToken //UnaryOperatorToken EOF IMPORT PUBLIC IDENTIFIER_VARIABLE FUNCTION_DEFINE FUNCTION_CALL IF_FUNCTION_CALL VARIABLE_DECLARE VARIABLE_OVERLOAD ARRAY_DECLARE ARRAY_CALL UNASIGNEDVAR ARGUMENT IF ELSE FOR RETURN FIELD BOOL U8 U16 U32 U64 True False )