1 Commits

Author SHA1 Message Date
arnaucube
9f2587151f Remove unnecessary structs & polsC 2020-05-22 13:02:30 +02:00
5 changed files with 0 additions and 53 deletions

1
cli/.gitignore vendored
View File

@@ -1 +0,0 @@
cli

View File

@@ -34,7 +34,6 @@ type PkString struct {
DomainSize int `json:"domainSize"`
PolsA []map[string]string `json:"polsA"`
PolsB []map[string]string `json:"polsB"`
PolsC []map[string]string `json:"polsC"`
}
// WitnessString contains the Witness in string representation
@@ -149,10 +148,6 @@ func pkStringToPk(ps PkString) (*types.Pk, error) {
if err != nil {
return nil, err
}
p.PolsC, err = polsStringToBigInt(ps.PolsC)
if err != nil {
return nil, err
}
return &p, nil
}

View File

@@ -238,11 +238,6 @@ func testCircuitParsePkBin(t *testing.T, circuit string) {
assert.Equal(t, pkJ.B2, pk.B2)
assert.Equal(t, pkJ.C, pk.C)
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) {
@@ -279,17 +274,6 @@ func testGoCircomPkFormat(t *testing.T, circuit string) {
assert.Equal(t, pk.HExps, pkG.HExps)
assert.Equal(t, pk.PolsA, pkG.PolsA)
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) {

View File

@@ -13,36 +13,6 @@ import (
//"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
const (
GSIZE = 6

View File

@@ -83,7 +83,6 @@ type Pk struct {
DomainSize int
PolsA []map[int]*big.Int
PolsB []map[int]*big.Int
PolsC []map[int]*big.Int
}
// Witness contains the witness