Skip to content

Commit

Permalink
crypto/kzg4844: use the new trusted setup file and format
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong committed Oct 22, 2023
1 parent d2e481e commit e024b2a
Show file tree
Hide file tree
Showing 11 changed files with 8,362 additions and 8,323 deletions.
6 changes: 3 additions & 3 deletions crypto/kzg4844/kzg4844_ckzg_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"sync"

"github.com/CortexFoundation/CortexTheseus/common/hexutil"
gokzg4844 "github.com/crate-crypto/go-kzg-4844"
ckzg4844 "github.com/ethereum/c-kzg-4844/bindings/go"
gokzg4844 "github.com/crate-crypto/go-kzg-4844"
)

// ckzgAvailable signals whether the library was compiled into Geth.
Expand All @@ -47,8 +47,8 @@ func ckzgInit() {
if err = gokzg4844.CheckTrustedSetupIsWellFormed(params); err != nil {
panic(err)
}
g1s := make([]byte, len(params.SetupG1)*(len(params.SetupG1[0])-2)/2)
for i, g1 := range params.SetupG1 {
g1s := make([]byte, len(params.SetupG1Lagrange)*(len(params.SetupG1Lagrange[0])-2)/2)
for i, g1 := range params.SetupG1Lagrange {
copy(g1s[i*(len(g1)-2)/2:], hexutil.MustDecode(g1))
}
g2s := make([]byte, len(params.SetupG2)*(len(params.SetupG2[0])-2)/2)
Expand Down
12,422 changes: 4,162 additions & 8,260 deletions crypto/kzg4844/trusted_setup.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/cockroachdb/errors v1.11.1
github.com/cockroachdb/pebble v0.0.0-20231020221949-babd592d2360
github.com/consensys/gnark-crypto v0.12.1
github.com/crate-crypto/go-kzg-4844 v0.3.0
github.com/crate-crypto/go-kzg-4844 v0.7.0
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/deckarep/golang-set/v2 v2.3.1
github.com/docker/docker v24.0.6+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHH
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/crate-crypto/go-ipa v0.0.0-20230601170251-1830d0757c80 h1:DuBDHVjgGMPki7bAyh91+3cF1Vh34sAEdH8JQgbc2R0=
github.com/crate-crypto/go-ipa v0.0.0-20230601170251-1830d0757c80/go.mod h1:gzbVz57IDJgQ9rLQwfSk696JGWof8ftznEL9GoAv3NI=
github.com/crate-crypto/go-kzg-4844 v0.3.0 h1:UBlWE0CgyFqqzTI+IFyCzA7A3Zw4iip6uzRv5NIXG0A=
github.com/crate-crypto/go-kzg-4844 v0.3.0/go.mod h1:SBP7ikXEgDnUPONgm33HtuDZEDtWa3L4QtN1ocJSEQ4=
github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA=
github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
Expand Down
16 changes: 7 additions & 9 deletions vendor/github.com/crate-crypto/go-kzg-4844/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions vendor/github.com/crate-crypto/go-kzg-4844/errors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vendor/github.com/crate-crypto/go-kzg-4844/readme.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 12 additions & 38 deletions vendor/github.com/crate-crypto/go-kzg-4844/trusted_setup.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4,168 changes: 4,167 additions & 1 deletion vendor/github.com/crate-crypto/go-kzg-4844/trusted_setup.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ github.com/crate-crypto/go-ipa/banderwagon
github.com/crate-crypto/go-ipa/common
github.com/crate-crypto/go-ipa/common/parallel
github.com/crate-crypto/go-ipa/ipa
# github.com/crate-crypto/go-kzg-4844 v0.3.0
## explicit; go 1.18
# github.com/crate-crypto/go-kzg-4844 v0.7.0
## explicit; go 1.20
github.com/crate-crypto/go-kzg-4844
github.com/crate-crypto/go-kzg-4844/internal/kzg
github.com/crate-crypto/go-kzg-4844/internal/multiexp
Expand Down

0 comments on commit e024b2a

Please sign in to comment.