mirror of
https://github.com/arnaucube/go-circom-prover-verifier.git
synced 2026-02-07 11:26:44 +01:00
Compare commits
4 Commits
feature/pk
...
feature/rm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f2587151f | ||
|
|
e652f34753 | ||
|
|
42961f6b94 | ||
|
|
386758370e |
@@ -34,7 +34,6 @@ type PkString struct {
|
|||||||
DomainSize int `json:"domainSize"`
|
DomainSize int `json:"domainSize"`
|
||||||
PolsA []map[string]string `json:"polsA"`
|
PolsA []map[string]string `json:"polsA"`
|
||||||
PolsB []map[string]string `json:"polsB"`
|
PolsB []map[string]string `json:"polsB"`
|
||||||
PolsC []map[string]string `json:"polsC"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// WitnessString contains the Witness in string representation
|
// WitnessString contains the Witness in string representation
|
||||||
@@ -149,10 +148,6 @@ func pkStringToPk(ps PkString) (*types.Pk, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
p.PolsC, err = polsStringToBigInt(ps.PolsC)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &p, nil
|
return &p, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -297,17 +297,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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,36 +13,6 @@ import (
|
|||||||
//"fmt"
|
//"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Proof is the data structure of the Groth16 zkSNARK proof
|
|
||||||
type Proof struct {
|
|
||||||
A *bn256.G1
|
|
||||||
B *bn256.G2
|
|
||||||
C *bn256.G1
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pk holds the data structure of the ProvingKey
|
|
||||||
type Pk struct {
|
|
||||||
A []*bn256.G1
|
|
||||||
B2 []*bn256.G2
|
|
||||||
B1 []*bn256.G1
|
|
||||||
C []*bn256.G1
|
|
||||||
NVars int
|
|
||||||
NPublic int
|
|
||||||
VkAlpha1 *bn256.G1
|
|
||||||
VkDelta1 *bn256.G1
|
|
||||||
VkBeta1 *bn256.G1
|
|
||||||
VkBeta2 *bn256.G2
|
|
||||||
VkDelta2 *bn256.G2
|
|
||||||
HExps []*bn256.G1
|
|
||||||
DomainSize int
|
|
||||||
PolsA []map[int]*big.Int
|
|
||||||
PolsB []map[int]*big.Int
|
|
||||||
PolsC []map[int]*big.Int
|
|
||||||
}
|
|
||||||
|
|
||||||
// Witness contains the witness
|
|
||||||
type Witness []*big.Int
|
|
||||||
|
|
||||||
// Group Size
|
// Group Size
|
||||||
const (
|
const (
|
||||||
GSIZE = 6
|
GSIZE = 6
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ type Pk struct {
|
|||||||
DomainSize int
|
DomainSize int
|
||||||
PolsA []map[int]*big.Int
|
PolsA []map[int]*big.Int
|
||||||
PolsB []map[int]*big.Int
|
PolsB []map[int]*big.Int
|
||||||
PolsC []map[int]*big.Int
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Witness contains the witness
|
// Witness contains the witness
|
||||||
|
|||||||
Reference in New Issue
Block a user