Skip to content

Commit

Permalink
fix: several typos in the documentation (#943)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
tudorpintea999 authored Dec 4, 2023
1 parent 64c88cb commit b5ecc0e
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion backend/groth16/groth16.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
4 changes: 2 additions & 2 deletions examples/plonk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/rollup/circuit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/rollup/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions examples/rollup/rollup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion frontend/cs/coeff_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
4 changes: 2 additions & 2 deletions frontend/cs/r1cs/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion frontend/cs/r1cs/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend/cs/r1cs/heap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion frontend/cs/scs/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion frontend/cs/scs/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b5ecc0e

Please sign in to comment.