@@ -2,17 +2,18 @@ package main
2
2
3
3
import (
4
4
"fmt"
5
+ "log"
6
+
5
7
"github.com/consensys/gnark-crypto/ecc"
6
8
bls12381_ecc "github.com/consensys/gnark-crypto/ecc/bls12-381"
7
9
"github.com/consensys/gnark/backend/groth16"
8
10
"github.com/consensys/gnark/frontend"
9
11
"github.com/consensys/gnark/frontend/cs/r1cs"
10
12
bls12381 "github.com/consensys/gnark/std/algebra/emulated/sw_bls12381"
11
- "log"
12
13
)
13
14
14
15
const (
15
- SignatureNum = 2
16
+ SignatureNum = 16
16
17
)
17
18
18
19
// Circuit Boneh-Lynn-Shacham (BLS) signature verification
@@ -35,13 +36,13 @@ func (circuit *Circuit) Define(api frontend.API) error {
35
36
pl , _ := pair .Pair ([]* bls12381.G1Affine {& circuit .Sig }, []* bls12381.G2Affine {& circuit .G2 })
36
37
37
38
hm := []* bls12381.G1Affine {}
38
- for _ , v := range circuit .Hm {
39
- hm = append (hm , & v )
39
+ for k , _ := range circuit .Hm {
40
+ hm = append (hm , & circuit . Hm [ k ] )
40
41
}
41
42
42
43
pk := []* bls12381.G2Affine {}
43
- for _ , v := range circuit .Pk {
44
- pk = append (pk , & v )
44
+ for k , _ := range circuit .Pk {
45
+ pk = append (pk , & circuit . Pk [ k ] )
45
46
}
46
47
pr , _ := pair .Pair (hm , pk )
47
48
pair .AssertIsEqual (pl , pr )
0 commit comments