Skip to content

Commit

Permalink
fix: use consecutive powers instead of squaring (#1212)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivokub committed Jul 18, 2024
1 parent 4cc13fd commit de4fa56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions std/multicommit/nativecommit.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,16 @@ func (mct *multicommitter) commitAndCall(api frontend.API) error {
if !ok {
panic("compiler doesn't implement frontend.Committer")
}
cmt, err := commiter.Commit(mct.vars...)
rootCmt, err := commiter.Commit(mct.vars...)
if err != nil {
return fmt.Errorf("commit: %w", err)
}
cmt := rootCmt
if err = mct.cbs[0](api, cmt); err != nil {
return fmt.Errorf("callback 0: %w", err)
}
for i := 1; i < len(mct.cbs); i++ {
cmt = api.Mul(cmt, cmt)
cmt = api.Mul(rootCmt, cmt)
if err := mct.cbs[i](api, cmt); err != nil {
return fmt.Errorf("callback %d: %w", i, err)
}
Expand Down

0 comments on commit de4fa56

Please sign in to comment.