Skip to content

Commit

Permalink
perf: normalize the random linear combination in logderivarg (#1333)
Browse files Browse the repository at this point in the history
  • Loading branch information
kustosz authored Dec 2, 2024
1 parent 53ce9b7 commit 92b9823
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions std/internal/logderivarg/logderivarg.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,13 @@ func Build(api frontend.API, table Table, queries Table) error {
}

func randLinearCoefficients(api frontend.API, nbRow int, commitment frontend.Variable) (rowCoeffs []frontend.Variable, challenge frontend.Variable) {
if nbRow == 1 {
return []frontend.Variable{1}, commitment
}
hasher, err := mimc.NewMiMC(api)
if err != nil {
panic(err)
}
rowCoeffs = make([]frontend.Variable, nbRow)
for i := 0; i < nbRow; i++ {
rowCoeffs[0] = 1
for i := 1; i < nbRow; i++ {
hasher.Reset()
hasher.Write(i+1, commitment)
rowCoeffs[i] = hasher.Sum()
Expand Down

0 comments on commit 92b9823

Please sign in to comment.