From b5ecc0e2b697c4c95b8c07884ab6cb999dbcadc0 Mon Sep 17 00:00:00 2001 From: iwantanode <87604944+tudorpintea999@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:27:00 +0200 Subject: [PATCH] fix: several typos in the documentation (#943) * fix typo groth16.go * fix typo main.go * fix typo circuit_test.go * fix typo operator.go * fix typos rollup_test.go * fix typos api.go * fix typo builder.go * fix typo heap.go * fix typo api.go * fix typo builder.go * fix typo coeff_table.go --- backend/groth16/groth16.go | 2 +- examples/plonk/main.go | 4 ++-- examples/rollup/circuit_test.go | 2 +- examples/rollup/operator.go | 4 ++-- examples/rollup/rollup_test.go | 4 ++-- frontend/cs/coeff_table.go | 2 +- frontend/cs/r1cs/api.go | 4 ++-- frontend/cs/r1cs/builder.go | 2 +- frontend/cs/r1cs/heap.go | 2 +- frontend/cs/scs/api.go | 2 +- frontend/cs/scs/builder.go | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/backend/groth16/groth16.go b/backend/groth16/groth16.go index 25b60cebca..ca5b8bdc61 100644 --- a/backend/groth16/groth16.go +++ b/backend/groth16/groth16.go @@ -200,7 +200,7 @@ func Prove(r1cs constraint.ConstraintSystem, pk ProvingKey, fullWitness witness. // Setup runs groth16.Setup with provided R1CS and outputs a key pair associated with the circuit. // -// Note that careful consideration must be given to this step in production environment. +// Note that careful consideration must be given to this step in a production environment. // groth16.Setup uses some randomness to precompute the Proving and Verifying keys. If the process // or machine leaks this randomness, an attacker could break the ZKP protocol. // diff --git a/examples/plonk/main.go b/examples/plonk/main.go index 80aeea5eaf..b537c226a9 100644 --- a/examples/plonk/main.go +++ b/examples/plonk/main.go @@ -108,7 +108,7 @@ func main() { log.Fatal(err) } - // public data consists the polynomials describing the constants involved + // public data consists of the polynomials describing the constants involved // in the constraints, the polynomial describing the permutation ("grand // product argument"), and the FFT domains. pk, vk, err := plonk.Setup(ccs, srs) @@ -149,7 +149,7 @@ func main() { log.Fatal(err) } - // public data consists the polynomials describing the constants involved + // public data consists of the polynomials describing the constants involved // in the constraints, the polynomial describing the permutation ("grand // product argument"), and the FFT domains. pk, vk, err := plonk.Setup(ccs, srs) diff --git a/examples/rollup/circuit_test.go b/examples/rollup/circuit_test.go index 0fc65549c7..d0ac490b89 100644 --- a/examples/rollup/circuit_test.go +++ b/examples/rollup/circuit_test.go @@ -28,7 +28,7 @@ import ( type circuitSignature Circuit -// Circuit implements part of the rollup circuit only by delcaring a subset of the constraints +// Circuit implements part of the rollup circuit only by declaring a subset of the constraints func (t *circuitSignature) Define(api frontend.API) error { if err := (*Circuit)(t).postInit(api); err != nil { return err diff --git a/examples/rollup/operator.go b/examples/rollup/operator.go index b3a73aef91..c4bee69c1d 100644 --- a/examples/rollup/operator.go +++ b/examples/rollup/operator.go @@ -35,7 +35,7 @@ type Queue struct { listTransfers chan Transfer } -// NewQueue creates a new queue, BatchSizeCircuit is the capaciy +// NewQueue creates a new queue, BatchSizeCircuit is the capacity func NewQueue(BatchSizeCircuit int) Queue { resChan := make(chan Transfer, BatchSizeCircuit) var res Queue @@ -52,7 +52,7 @@ type Operator struct { h hash.Hash // hash function used to build the Merkle Tree q Queue // queue of transfers batch int // current number of transactions in a batch - witnesses Circuit // witnesses for the snark cicruit + witnesses Circuit // witnesses for the snark circuit } // NewOperator creates a new operator. diff --git a/examples/rollup/rollup_test.go b/examples/rollup/rollup_test.go index f3ee72575c..bbf30110a0 100644 --- a/examples/rollup/rollup_test.go +++ b/examples/rollup/rollup_test.go @@ -33,7 +33,7 @@ func TestOperatorReadAccount(t *testing.T) { // create operator with 10 accounts operator, _ := createOperator(10) - // check if the account read from the operator are correct + // check if the account read from the operator is correct for i := 0; i < 10; i++ { opAccount, err := operator.readAccount(uint64(i)) if err != nil { @@ -168,7 +168,7 @@ func createAccount(i int) (Account, eddsa.PrivateKey) { return acc, privkey } -// Returns a newly created operator and tha private keys of the associated accounts +// Returns a newly created operator and the private keys of the associated accounts func createOperator(nbAccounts int) (Operator, []eddsa.PrivateKey) { operator := NewOperator(nbAccounts) diff --git a/frontend/cs/coeff_table.go b/frontend/cs/coeff_table.go index c9a26c3cec..f27b33928c 100644 --- a/frontend/cs/coeff_table.go +++ b/frontend/cs/coeff_table.go @@ -33,7 +33,7 @@ func NewCoeffTable() CoeffTable { return st } -// CoeffID tries to fetch the entry where b is if it exits, otherwise appends b to +// CoeffID tries to fetch the entry where b is if it exists, otherwise appends b to // the list of Coeffs and returns the corresponding entry func (t *CoeffTable) CoeffID(v *big.Int) int { diff --git a/frontend/cs/r1cs/api.go b/frontend/cs/r1cs/api.go index 6b6eeeb633..2d335fd54d 100644 --- a/frontend/cs/r1cs/api.go +++ b/frontend/cs/r1cs/api.go @@ -91,7 +91,7 @@ func (builder *builder) MulAcc(a, b, c frontend.Variable) frontend.Variable { // it fits, no mem alloc _a = append(_a, builder.mbuf2...) } else { - // allocate a expression linear with extended capacity + // allocate an expression linear with extended capacity _a = make(expr.LinearExpression, len(builder.mbuf2), len(builder.mbuf2)*3) copy(_a, builder.mbuf2) } @@ -350,7 +350,7 @@ func (builder *builder) Inverse(i1 frontend.Variable) frontend.Variable { // n is the number of bits to select (starting from lsb) // n default value is fr.Bits the number of bits needed to represent a field element // -// The result in in little endian (first bit= lsb) +// The result is in little endian (first bit= lsb) func (builder *builder) ToBinary(i1 frontend.Variable, n ...int) []frontend.Variable { // nbBits nbBits := builder.cs.FieldBitLen() diff --git a/frontend/cs/r1cs/builder.go b/frontend/cs/r1cs/builder.go index 1a27261bda..145fc33d0e 100644 --- a/frontend/cs/r1cs/builder.go +++ b/frontend/cs/r1cs/builder.go @@ -316,7 +316,7 @@ func (builder *builder) constantValue(v frontend.Variable) (constraint.Element, return builder.cs.FromInterface(v), true } -// toVariable will return (and allocate if neccesary) a linearExpression from given value +// toVariable will return (and allocate if necessary) a linearExpression from given value // // if input is already a linearExpression, does nothing // else, attempts to convert input to a big.Int (see utils.FromInterface) and returns a toVariable linearExpression diff --git a/frontend/cs/r1cs/heap.go b/frontend/cs/r1cs/heap.go index 07c6bc436e..b0068f8043 100644 --- a/frontend/cs/r1cs/heap.go +++ b/frontend/cs/r1cs/heap.go @@ -79,7 +79,7 @@ func (h *minHeap) down(i0, n int) bool { return i > i0 } -// linMeta stores meta data to iterate over a linear expression +// linMeta stores metadata to iterate over a linear expression type linMeta struct { lID int // argument ID to retrieve the position of the list in the argument tID int // termID current iteration position (starts at 0) diff --git a/frontend/cs/scs/api.go b/frontend/cs/scs/api.go index 4da6fab118..719bd21407 100644 --- a/frontend/cs/scs/api.go +++ b/frontend/cs/scs/api.go @@ -232,7 +232,7 @@ func (builder *builder) Inverse(i1 frontend.Variable) frontend.Variable { // n is the number of bits to select (starting from lsb) // n default value is fr.Bits the number of bits needed to represent a field element // -// The result in in little endian (first bit= lsb) +// The result is in little endian (first bit= lsb) func (builder *builder) ToBinary(i1 frontend.Variable, n ...int) []frontend.Variable { // nbBits nbBits := builder.cs.FieldBitLen() diff --git a/frontend/cs/scs/builder.go b/frontend/cs/scs/builder.go index 32a036e6a3..16a9ddd289 100644 --- a/frontend/cs/scs/builder.go +++ b/frontend/cs/scs/builder.go @@ -56,7 +56,7 @@ type builder struct { // map for recording boolean constrained variables (to not constrain them twice) mtBooleans map[expr.Term]struct{} - // records multiplications constraint to avoid duplicate. + // records multiplications constraint to avoid duplicates. // see mulConstraintExist(...) mMulInstructions map[uint64]int