Skip to content

Commit

Permalink
change kzg trusted setup to use values from consensus spec (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto-bayardo authored Nov 17, 2022
1 parent 60ce55a commit 381b51e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/vm/testdata/precompiles/pointEvaluation.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"Input": "01d0db71b458e8955efa3ef62f1b6b45a2d9c8633dc59ed0b995cecf8b7bb48442000000000000000000000000000000000000000000000000000000000000003b11ebd59d5d12d6ef8e5e48f71770515e032595a0e55eaf80e906b65b2a625282bead0f31f58ee4fd81e93f796bb57acd6f8f6e4def04182c8e949c71ea00d85a44c12102bd817bc97696a6b8fd75618fcd8c2030080c9602e08e935cdf6f779d0d89e7764d855edfbaa730eddfff836fc324957db4f74d1565503bcfcaf157",
"Input": "013c03613f6fc558fb7e61e75602241ed9a2f04e36d8670aadd286e71b5ca9cc420000000000000000000000000000000000000000000000000000000000000031e5a2356cbc2ef6a733eae8d54bf48719ae3d990017ca787c419c7d369f8e3c83fac17c3f237fc51f90e2c660eb202a438bc2025baded5cd193c1a018c5885bc9281ba704d5566082e851235c7be763b2a99adff965e0a121ee972ebc472d02944a74f5c6243e14052e105124b70bf65faf85ad3a494325e269fad097842cba",
"Expected": "",
"Name": "pointEvaluation1",
"Gas": 50000,
Expand Down
7 changes: 3 additions & 4 deletions crypto/kzg/kzg.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ var kzgSetupLagrange []bls.G1Point
var KzgSetupG1 []bls.G1Point

type JSONTrustedSetup struct {
SetupG1 []bls.G1Point
SetupG2 []bls.G2Point
SetupLagrange []bls.G1Point
SetupG1 []bls.G1Point `json:"setup_G1"`
SetupG2 []bls.G2Point `json:"setup_G2"`
SetupLagrange []bls.G1Point `json:"setup_G1_lagrange"`
}

// Initialize KZG subsystem (load the trusted setup data)
Expand All @@ -50,7 +50,6 @@ func init() {
if err != nil {
panic(err)
}

kzgSetupG2 = parsedSetup.SetupG2
kzgSetupLagrange = bitReversalPermutation(parsedSetup.SetupLagrange)
KzgSetupG1 = parsedSetup.SetupG1
Expand Down
2 changes: 1 addition & 1 deletion crypto/kzg/kzg_trusted_setup.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/kzg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func TestGoKzg(t *testing.T) {

// Create proof for testing
x := uint64(17)
proof := ComputeProof(polynomial, x, kzg.KzgSetupG1)
proof := ComputeProof(polynomial, x, kzgSetupG1)

// Get actual evaluation at x
var xFr bls.Fr
Expand Down

0 comments on commit 381b51e

Please sign in to comment.