mirror of
https://github.com/arnaucube/go-circom-prover-verifier.git
synced 2026-02-07 03:16:46 +01:00
Compare commits
4 Commits
feature/pk
...
feature/mi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d4b1abc10 | ||
|
|
e652f34753 | ||
|
|
42961f6b94 | ||
|
|
386758370e |
1
cli/.gitignore
vendored
Normal file
1
cli/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
cli
|
||||||
@@ -238,6 +238,11 @@ func testCircuitParsePkBin(t *testing.T, circuit string) {
|
|||||||
assert.Equal(t, pkJ.B2, pk.B2)
|
assert.Equal(t, pkJ.B2, pk.B2)
|
||||||
assert.Equal(t, pkJ.C, pk.C)
|
assert.Equal(t, pkJ.C, pk.C)
|
||||||
assert.Equal(t, pkJ.HExps[:pkJ.DomainSize], pk.HExps[:pk.DomainSize]) // circom behaviour
|
assert.Equal(t, pkJ.HExps[:pkJ.DomainSize], pk.HExps[:pk.DomainSize]) // circom behaviour
|
||||||
|
|
||||||
|
assert.Equal(t, pkJ.NVars, pk.NVars)
|
||||||
|
assert.Equal(t, pkJ.NPublic, pk.NPublic)
|
||||||
|
assert.Equal(t, pkJ.DomainSize, pk.DomainSize)
|
||||||
|
assert.Equal(t, pkJ.PolsC, pk.PolsC)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestParsePkBin(t *testing.T) {
|
func TestParsePkBin(t *testing.T) {
|
||||||
@@ -274,6 +279,17 @@ func testGoCircomPkFormat(t *testing.T, circuit string) {
|
|||||||
assert.Equal(t, pk.HExps, pkG.HExps)
|
assert.Equal(t, pk.HExps, pkG.HExps)
|
||||||
assert.Equal(t, pk.PolsA, pkG.PolsA)
|
assert.Equal(t, pk.PolsA, pkG.PolsA)
|
||||||
assert.Equal(t, pk.PolsB, pkG.PolsB)
|
assert.Equal(t, pk.PolsB, pkG.PolsB)
|
||||||
|
|
||||||
|
assert.Equal(t, pk.NVars, pkG.NVars)
|
||||||
|
assert.Equal(t, pk.NPublic, pkG.NPublic)
|
||||||
|
assert.Equal(t, pk.DomainSize, pkG.DomainSize)
|
||||||
|
assert.Equal(t, pk.PolsC, pkG.PolsC)
|
||||||
|
|
||||||
|
// pkPrettyJSON, err := json.MarshalIndent(pk, "", " ")
|
||||||
|
// require.Nil(t, err)
|
||||||
|
// pkGoPrettyJSON, err := json.MarshalIndent(pkG, "", " ")
|
||||||
|
// require.Nil(t, err)
|
||||||
|
// assert.Equal(t, pkPrettyJSON, pkGoPrettyJSON)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGoCircomPkFormat(t *testing.T) {
|
func TestGoCircomPkFormat(t *testing.T) {
|
||||||
@@ -297,17 +313,22 @@ func benchmarkParsePk(b *testing.B, circuit string) {
|
|||||||
|
|
||||||
b.Run("ParsePkJson "+circuit, func(b *testing.B) {
|
b.Run("ParsePkJson "+circuit, func(b *testing.B) {
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
ParsePkBin(pkBinFile)
|
_, err = ParsePk(pkJson)
|
||||||
|
require.Nil(b, err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
b.Run("ParsePkBin "+circuit, func(b *testing.B) {
|
b.Run("ParsePkBin "+circuit, func(b *testing.B) {
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
ParsePk(pkJson)
|
pkBinFile.Seek(0, 0)
|
||||||
|
_, err = ParsePkBin(pkBinFile)
|
||||||
|
require.Nil(b, err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
b.Run("ParsePkGoBin "+circuit, func(b *testing.B) {
|
b.Run("ParsePkGoBin "+circuit, func(b *testing.B) {
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
ParsePkGoBin(pkBinFile)
|
pkGoBinFile.Seek(0, 0)
|
||||||
|
_, err = ParsePkGoBin(pkGoBinFile)
|
||||||
|
require.Nil(b, err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user