├── .github └── workflows │ ├── pr.yml │ └── push.yml ├── .gitignore ├── .gitlint ├── Makefile ├── README.md ├── ecc └── interop │ ├── bls12-381 │ └── interop_test.go │ └── bn254 │ └── interop_test.go ├── go.mod ├── go.sum └── solidity ├── abi ├── PlonkVerifier.abi ├── Utils.abi └── combined.json ├── contract └── main.go ├── generate.go ├── solidity_groth16_test.go └── solidity_plonk_test.go /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | on: pull_request 2 | name: pull_request 3 | jobs: 4 | staticcheck: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: install Go 8 | uses: actions/setup-go@v2 9 | with: 10 | go-version: 1.19.x 11 | - name: checkout code 12 | uses: actions/checkout@v2 13 | with: 14 | fetch-depth: 0 15 | - uses: actions/cache@v2 16 | with: 17 | path: | 18 | ~/go/pkg/mod 19 | ~/.cache/go-build 20 | ~/Library/Caches/go-build 21 | %LocalAppData%\go-build 22 | key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 23 | restore-keys: | 24 | ${{ runner.os }}-go- 25 | - name: golangci-lint 26 | uses: golangci/golangci-lint-action@v3 27 | with: 28 | args: --timeout=5m 29 | - name: install deps 30 | run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest 31 | - name: gofmt 32 | run: if [[ -n $(gofmt -l .) ]]; then echo "please run gofmt"; exit 1; fi 33 | - name: generated files should not be modified 34 | run: | 35 | go generate ./... 36 | git update-index --assume-unchanged go.mod 37 | git update-index --assume-unchanged go.sum 38 | if [[ -n $(git status --porcelain) ]]; then echo "git repo is dirty after runing go generate -- please don't modify generated files"; echo $(git diff);echo $(git status --porcelain); exit 1; fi 39 | 40 | test: 41 | strategy: 42 | matrix: 43 | go-version: [1.19.x] 44 | os: [ubuntu-latest] 45 | runs-on: ${{ matrix.os }} 46 | needs: 47 | - staticcheck 48 | steps: 49 | - name: install Go 50 | uses: actions/setup-go@v2 51 | with: 52 | go-version: ${{ matrix.go-version }} 53 | - name: checkout code 54 | uses: actions/checkout@v2 55 | - uses: actions/cache@v2 56 | with: 57 | path: | 58 | ~/go/pkg/mod 59 | ~/.cache/go-build 60 | ~/Library/Caches/go-build 61 | %LocalAppData%\go-build 62 | key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 63 | restore-keys: | 64 | ${{ runner.os }}-go- 65 | - name: install deps 66 | run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest 67 | - name: Test 68 | run: | 69 | go test -v -short -timeout=30m ./... 70 | 71 | slack-workflow-status-failed: 72 | if: failure() 73 | name: post workflow status to slack 74 | needs: 75 | - staticcheck 76 | - test 77 | runs-on: ubuntu-latest 78 | steps: 79 | - name: Notify slack -- workflow failed 80 | id: slack 81 | uses: slackapi/slack-github-action@v1.19.0 82 | with: 83 | payload: | 84 | { 85 | "actor": "${{ github.actor }}", 86 | "repo": "${{ github.repository }}", 87 | "status": "FAIL", 88 | "title": "${{ github.event.pull_request.title }}", 89 | "pr": "${{ github.event.pull_request.head.ref }}" 90 | } 91 | env: 92 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} 93 | 94 | slack-workflow-status-success: 95 | if: success() 96 | name: post workflow status to slack 97 | needs: 98 | - staticcheck 99 | - test 100 | runs-on: ubuntu-latest 101 | steps: 102 | - name: Notify slack -- workflow succeeded 103 | id: slack 104 | uses: slackapi/slack-github-action@v1.19.0 105 | with: 106 | payload: | 107 | { 108 | "actor": "${{ github.actor }}", 109 | "repo": "${{ github.repository }}", 110 | "status": "SUCCESS", 111 | "title": "${{ github.event.pull_request.title }}", 112 | "pr": "${{ github.event.pull_request.head.ref }}" 113 | } 114 | env: 115 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_SUCCESS }} -------------------------------------------------------------------------------- /.github/workflows/push.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - 'master' 5 | - 'develop' 6 | name: push_master_develop 7 | jobs: 8 | staticcheck: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: install Go 12 | uses: actions/setup-go@v2 13 | with: 14 | go-version: 1.19.x 15 | - name: checkout code 16 | uses: actions/checkout@v2 17 | with: 18 | fetch-depth: 0 19 | - uses: actions/cache@v2 20 | with: 21 | path: | 22 | ~/go/pkg/mod 23 | ~/.cache/go-build 24 | ~/Library/Caches/go-build 25 | %LocalAppData%\go-build 26 | key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 27 | restore-keys: | 28 | ${{ runner.os }}-go- 29 | - name: golangci-lint 30 | uses: golangci/golangci-lint-action@v3 31 | with: 32 | args: --timeout=5m 33 | - name: install deps 34 | run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest 35 | - name: gofmt 36 | run: if [[ -n $(gofmt -l .) ]]; then echo "please run gofmt"; exit 1; fi 37 | - name: generated files should not be modified 38 | run: | 39 | go generate ./... 40 | git update-index --assume-unchanged go.mod 41 | git update-index --assume-unchanged go.sum 42 | if [[ -n $(git status --porcelain) ]]; then echo "git repo is dirty after runing go generate -- please don't modify generated files"; echo $(git diff);echo $(git status --porcelain); exit 1; fi 43 | 44 | test: 45 | strategy: 46 | matrix: 47 | go-version: [1.19.x] 48 | os: [ubuntu-latest, windows-latest, macos-latest] 49 | runs-on: ${{ matrix.os }} 50 | needs: 51 | - staticcheck 52 | steps: 53 | - name: install Go 54 | uses: actions/setup-go@v2 55 | with: 56 | go-version: ${{ matrix.go-version }} 57 | - name: checkout code 58 | uses: actions/checkout@v2 59 | - uses: actions/cache@v2 60 | with: 61 | path: | 62 | ~/go/pkg/mod 63 | ~/.cache/go-build 64 | ~/Library/Caches/go-build 65 | %LocalAppData%\go-build 66 | key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 67 | restore-keys: | 68 | ${{ runner.os }}-go- 69 | - name: install deps 70 | run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest 71 | - name: Test 72 | run: | 73 | go test -v -timeout=30m ./... 74 | - name: Test (race) 75 | if: matrix.os == 'ubuntu-latest' 76 | run: | 77 | go test -v -timeout=50m -race -short ./... 78 | 79 | slack-workflow-status-failed: 80 | if: failure() 81 | name: post workflow status to slack 82 | needs: 83 | - staticcheck 84 | - test 85 | runs-on: ubuntu-latest 86 | steps: 87 | - name: Notify slack -- workflow failed 88 | id: slack 89 | uses: slackapi/slack-github-action@v1.19.0 90 | with: 91 | payload: | 92 | { 93 | "actor": "${{ github.actor }}", 94 | "repo": "${{ github.repository }}", 95 | "status": "FAIL", 96 | "title": "push to ${{ github.event.push.base_ref }}", 97 | "pr": "" 98 | } 99 | env: 100 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} 101 | 102 | slack-workflow-status-success: 103 | if: success() 104 | name: post workflow status to slack 105 | needs: 106 | - staticcheck 107 | - test 108 | runs-on: ubuntu-latest 109 | steps: 110 | - name: Notify slack -- workflow succeeded 111 | id: slack 112 | uses: slackapi/slack-github-action@v1.19.0 113 | with: 114 | payload: | 115 | { 116 | "actor": "${{ github.actor }}", 117 | "repo": "${{ github.repository }}", 118 | "status": "SUCCESS", 119 | "title": "push to ${{ github.event.push.base_ref }}", 120 | "pr": "" 121 | } 122 | env: 123 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_SUCCESS }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.bin 3 | *.sol 4 | *.pk 5 | *.vk 6 | *.srs 7 | solidity/solidity_groth16.go 8 | solidity/solidity_plonk.go -------------------------------------------------------------------------------- /.gitlint: -------------------------------------------------------------------------------- 1 | [general] 2 | 3 | contrib=contrib-title-conventional-commits 4 | ignore=B6 5 | 6 | # This is a contrib rule - a community contributed rule. These are disabled by default. 7 | # You need to explicitly enable them one-by-one by adding them to the "contrib" option 8 | # under [general] section above. 9 | # [contrib-title-conventional-commits] 10 | # Specify allowed commit types. For details see: https://www.conventionalcommits.org/ 11 | # types = bugfix,user-story,epic 12 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash 2 | 3 | .PHONY: generator-sol clean-abi-generated solc abigen 4 | 5 | all: generator-sol abigen go-test 6 | 7 | generator-sol: 8 | cd solidity && go run contract/main.go 9 | 10 | clean-abi-generated: 11 | cd solidity && rm -fr ./abi/* 12 | 13 | solc: clean-abi-generated 14 | cd solidity && solc --bin --abi -o ./abi contract_g16.sol 15 | cd solidity && solc --bin --abi -o ./abi contract_plonk.sol 16 | 17 | abigen: solc 18 | cd solidity && abigen --bin ./abi/Verifier.bin --abi abi/Verifier.abi --pkg solidity --out solidity_groth16.go --type Verifier 19 | cd solidity && abigen --bin ./abi/KeyedPlonkVerifier.bin --abi abi/KeyedPlonkVerifier.abi --pkg solidity --out solidity_plonk.go --type KeyedPlonkVerifier 20 | 21 | go-test: 22 | cd solidity && go test 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gnark-tests 2 | 3 | **UNUSED / archived**, superseded by https://github.com/ConsenSys/gnark-solidity-checker and CI tests in gnark directly. 4 | 5 | 6 | This repo contains tests (interop or integration) that may drag some extra dependencies, for the following projects: 7 | 8 | * [`gnark`: a framework to execute (and verify) algorithms in zero-knowledge](https://github.com/consensys/gnark) 9 | * [`gnark-crypto`](https://github.com/consensys/gnark-crypto) 10 | 11 | ## Solidity verifier (groth16 and plonk) 12 | 13 | ```bash 14 | cd solidity 15 | go generate 16 | go test 17 | ``` 18 | or 19 | ```bash 20 | make 21 | ``` 22 | 23 | Note that since the verifying key of the contract is included in the `solidity/contract.sol`, changes to gnark version or circuit should result in running `go generate` to regenerate keys and solidity contracts. 24 | 25 | It needs `solc` and `abigen` (1.10.17-stable). 26 | -------------------------------------------------------------------------------- /ecc/interop/bls12-381/interop_test.go: -------------------------------------------------------------------------------- 1 | package interop 2 | 3 | import ( 4 | "bytes" 5 | "crypto/rand" 6 | "math/big" 7 | "testing" 8 | 9 | bls12381 "github.com/kilic/bls12-381" 10 | 11 | bls381 "github.com/consensys/gnark-crypto/ecc/bls12-381" 12 | "github.com/consensys/gnark-crypto/ecc/bls12-381/fp" 13 | "github.com/leanovate/gopter" 14 | "github.com/leanovate/gopter/prop" 15 | ) 16 | 17 | // Test against github.com/kilic/bls12-381 18 | 19 | var ( 20 | g1Gen bls381.G1Jac 21 | g2Gen bls381.G2Jac 22 | g1GenAff bls381.G1Affine 23 | g2GenAff bls381.G2Affine 24 | ) 25 | 26 | func init() { 27 | g1Gen, g2Gen, g1GenAff, g2GenAff = bls381.Generators() 28 | } 29 | 30 | func TestG1AffineSerializationInterop(t *testing.T) { 31 | parameters := gopter.DefaultTestParameters() 32 | parameters.MinSuccessfulTests = 100 33 | 34 | properties := gopter.NewProperties(parameters) 35 | 36 | properties.Property("[BLS381] G1: gnark-crypto -> bls12-381 -> gnark-crypto should stay constant", prop.ForAll( 37 | func(a fp.Element) bool { 38 | var start, end bls381.G1Affine 39 | var ab big.Int 40 | a.ToBigIntRegular(&ab) 41 | start.ScalarMultiplication(&g1GenAff, &ab) 42 | 43 | g1 := bls12381.NewG1() 44 | other, err := g1.FromBytes(start.Marshal()) 45 | if err != nil { 46 | t.Log(err) 47 | return false 48 | } 49 | // reconstruct a gnark-crypto point from bytes 50 | err = end.Unmarshal(g1.ToBytes(other)) 51 | if err != nil { 52 | return false 53 | } 54 | return start.X.Equal(&end.X) && start.Y.Equal(&end.Y) 55 | }, 56 | genFp(), 57 | )) 58 | 59 | properties.Property("[BLS381] G1 compressed: gnark-crypto -> bls12-381 -> gnark-crypto should stay constant", prop.ForAll( 60 | func(a fp.Element) bool { 61 | var start, end bls381.G1Affine 62 | var ab big.Int 63 | a.ToBigIntRegular(&ab) 64 | start.ScalarMultiplication(&g1GenAff, &ab) 65 | 66 | g1 := bls12381.NewG1() 67 | b := start.Bytes() 68 | other, err := g1.FromCompressed(b[:]) 69 | if err != nil { 70 | t.Log(err) 71 | return false 72 | } 73 | // reconstruct a gnark-crypto point from bytes 74 | err = end.Unmarshal(g1.ToCompressed(other)) 75 | if err != nil { 76 | return false 77 | } 78 | return start.X.Equal(&end.X) && start.Y.Equal(&end.Y) 79 | }, 80 | genFp(), 81 | )) 82 | 83 | properties.TestingRun(t, gopter.ConsoleReporter(false)) 84 | 85 | } 86 | 87 | func TestG2AffineSerializationInterop(t *testing.T) { 88 | parameters := gopter.DefaultTestParameters() 89 | parameters.MinSuccessfulTests = 100 90 | 91 | properties := gopter.NewProperties(parameters) 92 | 93 | properties.Property("[BLS381] G2: gnark-crypto -> bls12-381 -> gnark-crypto should stay constant", prop.ForAll( 94 | func(a fp.Element) bool { 95 | var start, end bls381.G2Affine 96 | var ab big.Int 97 | a.ToBigIntRegular(&ab) 98 | start.ScalarMultiplication(&g2GenAff, &ab) 99 | 100 | g2 := bls12381.NewG2() 101 | other, err := g2.FromBytes(start.Marshal()) 102 | if err != nil { 103 | t.Log(err) 104 | return false 105 | } 106 | // reconstruct a gnark-crypto point from bytes 107 | err = end.Unmarshal(g2.ToBytes(other)) 108 | if err != nil { 109 | return false 110 | } 111 | return start.X.Equal(&end.X) && start.Y.Equal(&end.Y) 112 | }, 113 | genFp(), 114 | )) 115 | 116 | properties.Property("[BLS381] G2 compressed: gnark-crypto -> bls12-381 -> gnark-crypto should stay constant", prop.ForAll( 117 | func(a fp.Element) bool { 118 | var start, end bls381.G2Affine 119 | var ab big.Int 120 | a.ToBigIntRegular(&ab) 121 | start.ScalarMultiplication(&g2GenAff, &ab) 122 | 123 | g2 := bls12381.NewG2() 124 | b := start.Bytes() 125 | other, err := g2.FromCompressed(b[:]) 126 | if err != nil { 127 | t.Log(err) 128 | return false 129 | } 130 | // reconstruct a gnark-crypto point from bytes 131 | err = end.Unmarshal(g2.ToCompressed(other)) 132 | if err != nil { 133 | return false 134 | } 135 | return start.X.Equal(&end.X) && start.Y.Equal(&end.Y) 136 | }, 137 | genFp(), 138 | )) 139 | 140 | properties.TestingRun(t, gopter.ConsoleReporter(false)) 141 | 142 | } 143 | 144 | func TestGTSerializationInterop(t *testing.T) { 145 | parameters := gopter.DefaultTestParameters() 146 | parameters.MinSuccessfulTests = 5 147 | 148 | properties := gopter.NewProperties(parameters) 149 | 150 | properties.Property("[BLS381] bls381.GT: gnark-crypto -> bls12-381 -> gnark-crypto should stay constant", prop.ForAll( 151 | func(start *bls381.GT) bool { 152 | var end bls381.GT 153 | *start = bls381.FinalExponentiation(start) // ensure we are in correct subgroup.. 154 | gt := bls12381.NewGT() 155 | other, err := gt.FromBytes(start.Marshal()) 156 | if err != nil { 157 | t.Log(err) 158 | return false 159 | } 160 | // reconstruct a bls381.GT from bytes 161 | err = end.Unmarshal(gt.ToBytes(other)) 162 | if err != nil { 163 | return false 164 | } 165 | return start.Equal(&end) 166 | }, 167 | genGT(), 168 | )) 169 | 170 | properties.TestingRun(t, gopter.ConsoleReporter(false)) 171 | 172 | } 173 | 174 | func TestScalarMultiplicationInterop(t *testing.T) { 175 | parameters := gopter.DefaultTestParameters() 176 | parameters.MinSuccessfulTests = 100 177 | 178 | properties := gopter.NewProperties(parameters) 179 | 180 | properties.Property("[BLS381] G1: scalarMultiplication interop", prop.ForAll( 181 | func(a, exp fp.Element) bool { 182 | var start, end bls381.G1Affine 183 | var ab, bExp big.Int 184 | a.ToBigIntRegular(&ab) 185 | exp.ToBigIntRegular(&bExp) 186 | start.ScalarMultiplication(&g1GenAff, &ab) 187 | 188 | g1 := bls12381.NewG1() 189 | other, err := g1.FromBytes(start.Marshal()) 190 | if err != nil { 191 | t.Log(err) 192 | return false 193 | } 194 | 195 | // perform the scalar multiplications 196 | otherRes := g1.MulScalarBig(g1.New(), other, &bExp) 197 | end.ScalarMultiplication(&start, &bExp) 198 | 199 | if !(bytes.Equal(g1.ToBytes(otherRes), end.Marshal())) { 200 | t.Log("scalar multiplication between bls12-381 and gnark-crypto is different") 201 | return false 202 | } 203 | 204 | return true 205 | }, 206 | genFp(), 207 | genFp(), 208 | )) 209 | 210 | properties.Property("[BLS381] G2: scalarMultiplication interop", prop.ForAll( 211 | func(a, exp fp.Element) bool { 212 | var start, end bls381.G2Affine 213 | var ab, bExp big.Int 214 | a.ToBigIntRegular(&ab) 215 | exp.ToBigIntRegular(&bExp) 216 | start.ScalarMultiplication(&g2GenAff, &ab) 217 | 218 | g2 := bls12381.NewG2() 219 | other, err := g2.FromBytes(start.Marshal()) 220 | if err != nil { 221 | t.Log(err) 222 | return false 223 | } 224 | 225 | // perform the scalar multiplications 226 | otherRes := g2.MulScalarBig(g2.New(), other, &bExp) 227 | end.ScalarMultiplication(&start, &bExp) 228 | 229 | if !(bytes.Equal(g2.ToBytes(otherRes), end.Marshal())) { 230 | t.Log("scalar multiplication between bls12-381 and gnark-crypto is different") 231 | return false 232 | } 233 | 234 | return true 235 | }, 236 | genFp(), 237 | genFp(), 238 | )) 239 | 240 | properties.TestingRun(t, gopter.ConsoleReporter(false)) 241 | } 242 | 243 | func TestPointAdditionInterop(t *testing.T) { 244 | parameters := gopter.DefaultTestParameters() 245 | parameters.MinSuccessfulTests = 100 246 | 247 | properties := gopter.NewProperties(parameters) 248 | 249 | properties.Property("[BLS381] checking point addition", prop.ForAll( 250 | func(a fp.Element) bool { 251 | var g1 bls381.G1Affine 252 | var g2 bls381.G2Affine 253 | var ab big.Int 254 | a.ToBigIntRegular(&ab) 255 | g1.ScalarMultiplication(&g1GenAff, &ab) 256 | g2.ScalarMultiplication(&g2GenAff, &ab) 257 | 258 | // do the same with other lib 259 | bls12381g1 := bls12381.NewG1() 260 | otherG1, err := bls12381g1.FromBytes(g1.Marshal()) 261 | if err != nil { 262 | return false 263 | } 264 | otherG1Gen, err := bls12381g1.FromBytes(g1GenAff.Marshal()) 265 | if err != nil { 266 | return false 267 | } 268 | bls12381g2 := bls12381.NewG2() 269 | otherG2, err := bls12381g2.FromBytes(g2.Marshal()) 270 | if err != nil { 271 | return false 272 | } 273 | otherG2Gen, err := bls12381g2.FromBytes(g2GenAff.Marshal()) 274 | if err != nil { 275 | return false 276 | } 277 | 278 | // add g1 to g1Gen and g2 to g2gen 279 | var _g1 bls381.G1Jac 280 | var _g2 bls381.G2Jac 281 | _g1.FromAffine(&g1) 282 | _g2.FromAffine(&g2) 283 | 284 | _g1.AddAssign(&g1Gen) 285 | g1.FromJacobian(&_g1) 286 | 287 | _g2.AddAssign(&g2Gen) 288 | g2.FromJacobian(&_g2) 289 | 290 | // results 291 | r1 := bls12381g1.Add(bls12381g1.New(), otherG1, otherG1Gen) 292 | r2 := bls12381g2.Add(bls12381g2.New(), otherG2, otherG2Gen) 293 | 294 | if !(bytes.Equal(g1.Marshal(), bls12381g1.ToBytes(r1))) { 295 | t.Log("g1 point addition doesn't match other implementation") 296 | return false 297 | } 298 | 299 | if !(bytes.Equal(g2.Marshal(), bls12381g2.ToBytes(r2))) { 300 | t.Log("g2 point addition doesn't match other implementation") 301 | return false 302 | } 303 | 304 | return true 305 | }, 306 | genFp(), 307 | )) 308 | 309 | properties.TestingRun(t, gopter.ConsoleReporter(false)) 310 | } 311 | 312 | func TestPairingInterop(t *testing.T) { 313 | parameters := gopter.DefaultTestParameters() 314 | parameters.MinSuccessfulTests = 100 315 | 316 | properties := gopter.NewProperties(parameters) 317 | 318 | properties.Property("[BLS381] pairing check interop", prop.ForAll( 319 | func(a fp.Element) bool { 320 | var g1 bls381.G1Affine 321 | var g2 bls381.G2Affine 322 | var ab big.Int 323 | a.ToBigIntRegular(&ab) 324 | g1.ScalarMultiplication(&g1GenAff, &ab) 325 | g2.ScalarMultiplication(&g2GenAff, &ab) 326 | 327 | // do the same with other lib 328 | otherG1, err := bls12381.NewG1().FromBytes(g1.Marshal()) 329 | if err != nil { 330 | return false 331 | } 332 | otherG2, err := bls12381.NewG2().FromBytes(g2.Marshal()) 333 | if err != nil { 334 | return false 335 | } 336 | 337 | // pairings 338 | engine := bls12381.NewEngine() 339 | engine.AddPair(otherG1, otherG2) 340 | otherResult := engine.Result() 341 | c, _ := bls381.Pair([]bls381.G1Affine{g1}, []bls381.G2Affine{g2}) 342 | 343 | if !(bytes.Equal(c.Marshal(), bls12381.NewGT().ToBytes(otherResult))) { 344 | t.Log("pairing doesn't match other implementation") 345 | return false 346 | } 347 | 348 | return true 349 | }, 350 | genFp(), 351 | )) 352 | 353 | properties.TestingRun(t, gopter.ConsoleReporter(false)) 354 | } 355 | 356 | func BenchmarkPairingInterop(b *testing.B) { 357 | var g1 bls381.G1Affine 358 | var g2 bls381.G2Affine 359 | var ab big.Int 360 | ab.SetUint64(42) 361 | g1.ScalarMultiplication(&g1GenAff, &ab) 362 | g2.ScalarMultiplication(&g2GenAff, &ab) 363 | 364 | b.Run("[BLS381]bls12381_pairing", func(b *testing.B) { 365 | otherG1, err := bls12381.NewG1().FromBytes(g1.Marshal()) 366 | if err != nil { 367 | b.Fatal(err) 368 | } 369 | otherG2, err := bls12381.NewG2().FromBytes(g2.Marshal()) 370 | if err != nil { 371 | b.Fatal(err) 372 | } 373 | b.ResetTimer() 374 | for i := 0; i < b.N; i++ { 375 | engine := bls12381.NewEngine() 376 | engine.AddPair(otherG1, otherG2) 377 | _ = engine.Result() 378 | } 379 | }) 380 | 381 | b.Run("[BLS381]gnark-crypto_pairing", func(b *testing.B) { 382 | b.ResetTimer() 383 | for i := 0; i < b.N; i++ { 384 | _, _ = bls381.Pair([]bls381.G1Affine{g1}, []bls381.G2Affine{g2}) 385 | } 386 | }) 387 | 388 | } 389 | 390 | func genFp() gopter.Gen { 391 | return func(genParams *gopter.GenParameters) *gopter.GenResult { 392 | var elmt fp.Element 393 | var b [fp.Bytes]byte 394 | rand.Read(b[:]) 395 | elmt.SetBytes(b[:]) 396 | genResult := gopter.NewGenResult(elmt, gopter.NoShrinker) 397 | return genResult 398 | } 399 | } 400 | 401 | func genGT() gopter.Gen { 402 | return gopter.CombineGens( 403 | genFp(), 404 | genFp(), 405 | genFp(), 406 | genFp(), 407 | genFp(), 408 | genFp(), 409 | genFp(), 410 | genFp(), 411 | genFp(), 412 | genFp(), 413 | genFp(), 414 | genFp(), 415 | ).Map(func(values []interface{}) *bls381.GT { 416 | var b [fp.Bytes * 12]byte 417 | rand.Read(b[:]) 418 | var r bls381.GT 419 | offset := 0 420 | r.C0.B0.A0.SetBytes(b[offset : offset+fp.Bytes]) 421 | offset += fp.Bytes 422 | r.C0.B0.A1.SetBytes(b[offset : offset+fp.Bytes]) 423 | offset += fp.Bytes 424 | r.C0.B1.A0.SetBytes(b[offset : offset+fp.Bytes]) 425 | offset += fp.Bytes 426 | r.C0.B1.A1.SetBytes(b[offset : offset+fp.Bytes]) 427 | offset += fp.Bytes 428 | r.C0.B2.A0.SetBytes(b[offset : offset+fp.Bytes]) 429 | offset += fp.Bytes 430 | r.C0.B2.A1.SetBytes(b[offset : offset+fp.Bytes]) 431 | offset += fp.Bytes 432 | 433 | r.C1.B0.A0.SetBytes(b[offset : offset+fp.Bytes]) 434 | offset += fp.Bytes 435 | r.C1.B0.A1.SetBytes(b[offset : offset+fp.Bytes]) 436 | offset += fp.Bytes 437 | r.C1.B1.A0.SetBytes(b[offset : offset+fp.Bytes]) 438 | offset += fp.Bytes 439 | r.C1.B1.A1.SetBytes(b[offset : offset+fp.Bytes]) 440 | offset += fp.Bytes 441 | r.C1.B2.A0.SetBytes(b[offset : offset+fp.Bytes]) 442 | offset += fp.Bytes 443 | r.C1.B2.A1.SetBytes(b[offset : offset+fp.Bytes]) 444 | offset += fp.Bytes 445 | 446 | return &r 447 | }) 448 | } 449 | -------------------------------------------------------------------------------- /ecc/interop/bn254/interop_test.go: -------------------------------------------------------------------------------- 1 | package interop 2 | 3 | import ( 4 | "bytes" 5 | "crypto/rand" 6 | "math/big" 7 | "testing" 8 | 9 | "github.com/consensys/gnark-crypto/ecc/bn254" 10 | "github.com/consensys/gnark-crypto/ecc/bn254/fp" 11 | "github.com/leanovate/gopter" 12 | "github.com/leanovate/gopter/prop" 13 | 14 | cloudflare "github.com/ethereum/go-ethereum/crypto/bn256/cloudflare" 15 | google "github.com/ethereum/go-ethereum/crypto/bn256/google" 16 | ) 17 | 18 | // Test against go-ethereum/crypto/bn256 implementations (google and cloudflare) 19 | 20 | var ( 21 | g1Gen bn254.G1Jac 22 | g2Gen bn254.G2Jac 23 | g1GenAff bn254.G1Affine 24 | g2GenAff bn254.G2Affine 25 | ) 26 | 27 | func init() { 28 | g1Gen, g2Gen, g1GenAff, g2GenAff = bn254.Generators() 29 | } 30 | 31 | func TestG1AffineSerializationInterop(t *testing.T) { 32 | parameters := gopter.DefaultTestParameters() 33 | parameters.MinSuccessfulTests = 100 34 | 35 | properties := gopter.NewProperties(parameters) 36 | 37 | properties.Property("[BN254] G1: gnark-crypto -> cloudflare -> gnark-crypto should stay constant", prop.ForAll( 38 | func(a fp.Element) bool { 39 | var start, end bn254.G1Affine 40 | var ab big.Int 41 | a.ToBigIntRegular(&ab) 42 | start.ScalarMultiplication(&g1GenAff, &ab) 43 | 44 | other, err := cloudflareG1(&start) 45 | if err != nil { 46 | t.Log(err) 47 | return false 48 | } 49 | 50 | // reconstruct a gnark-crypto point from bytes 51 | err = end.Unmarshal(other.Marshal()) 52 | if err != nil { 53 | return false 54 | } 55 | return start.X.Equal(&end.X) && start.Y.Equal(&end.Y) 56 | }, 57 | genFp(), 58 | )) 59 | 60 | properties.Property("[BN254] G1: gnark-crypto -> google -> gnark-crypto should stay constant", prop.ForAll( 61 | func(a fp.Element) bool { 62 | var start, end bn254.G1Affine 63 | var ab big.Int 64 | a.ToBigIntRegular(&ab) 65 | start.ScalarMultiplication(&g1GenAff, &ab) 66 | 67 | other, err := googleG1(&start) 68 | if err != nil { 69 | t.Log(err) 70 | return false 71 | } 72 | 73 | // reconstruct a gnark-crypto point from bytes 74 | err = end.Unmarshal(other.Marshal()) 75 | if err != nil { 76 | return false 77 | } 78 | return start.X.Equal(&end.X) && start.Y.Equal(&end.Y) 79 | }, 80 | genFp(), 81 | )) 82 | 83 | properties.TestingRun(t, gopter.ConsoleReporter(false)) 84 | 85 | } 86 | 87 | func TestG2AffineSerializationInterop(t *testing.T) { 88 | parameters := gopter.DefaultTestParameters() 89 | parameters.MinSuccessfulTests = 100 90 | 91 | properties := gopter.NewProperties(parameters) 92 | 93 | properties.Property("[BN254] G2: gnark-crypto -> cloudflare -> gnark-crypto should stay constant", prop.ForAll( 94 | func(a fp.Element) bool { 95 | var start, end bn254.G2Affine 96 | var ab big.Int 97 | a.ToBigIntRegular(&ab) 98 | start.ScalarMultiplication(&g2GenAff, &ab) 99 | 100 | other, err := cloudflareG2(&start) 101 | if err != nil { 102 | t.Log(err) 103 | return false 104 | } 105 | 106 | // reconstruct a gnark-crypto point from bytes 107 | err = end.Unmarshal(other.Marshal()) 108 | if err != nil { 109 | return false 110 | } 111 | return start.X.Equal(&end.X) && start.Y.Equal(&end.Y) 112 | }, 113 | genFp(), 114 | )) 115 | 116 | properties.Property("[BN254] G2: gnark-crypto -> google -> gnark-crypto should stay constant", prop.ForAll( 117 | func(a fp.Element) bool { 118 | var start, end bn254.G2Affine 119 | var ab big.Int 120 | a.ToBigIntRegular(&ab) 121 | start.ScalarMultiplication(&g2GenAff, &ab) 122 | 123 | other, err := googleG2(&start) 124 | if err != nil { 125 | t.Log(err) 126 | return false 127 | } 128 | 129 | // reconstruct a gnark-crypto point from bytes 130 | err = end.Unmarshal(other.Marshal()) 131 | if err != nil { 132 | return false 133 | } 134 | return start.X.Equal(&end.X) && start.Y.Equal(&end.Y) 135 | }, 136 | genFp(), 137 | )) 138 | 139 | properties.TestingRun(t, gopter.ConsoleReporter(false)) 140 | 141 | } 142 | 143 | func TestGTSerializationInterop(t *testing.T) { 144 | parameters := gopter.DefaultTestParameters() 145 | parameters.MinSuccessfulTests = 100 146 | 147 | properties := gopter.NewProperties(parameters) 148 | 149 | properties.Property("[BN254] bn254.GT: gnark-crypto -> cloudflare -> gnark-crypto should stay constant", prop.ForAll( 150 | func(start *bn254.GT) bool { 151 | var end bn254.GT 152 | cgt := new(cloudflare.GT) 153 | 154 | if _, err := cgt.Unmarshal(start.Marshal()); err != nil { 155 | t.Log(err) 156 | return false 157 | } 158 | 159 | err := end.Unmarshal(cgt.Marshal()) 160 | if err != nil { 161 | return false 162 | } 163 | return start.Equal(&end) 164 | }, 165 | genGT(), 166 | )) 167 | 168 | properties.Property("[BN254] bn254.GT: gnark-crypto -> google -> gnark-crypto should stay constant", prop.ForAll( 169 | func(start *bn254.GT) bool { 170 | var end bn254.GT 171 | cgt := new(google.GT) 172 | 173 | if _, ok := cgt.Unmarshal(start.Marshal()); !ok { 174 | return false 175 | } 176 | 177 | err := end.Unmarshal(cgt.Marshal()) 178 | if err != nil { 179 | return false 180 | } 181 | return start.Equal(&end) 182 | }, 183 | genGT(), 184 | )) 185 | 186 | properties.TestingRun(t, gopter.ConsoleReporter(false)) 187 | 188 | } 189 | 190 | func TestScalarMultiplicationInterop(t *testing.T) { 191 | parameters := gopter.DefaultTestParameters() 192 | parameters.MinSuccessfulTests = 100 193 | 194 | properties := gopter.NewProperties(parameters) 195 | 196 | properties.Property("[BN254] G1: scalarMultiplication interop", prop.ForAll( 197 | func(a, exp fp.Element) bool { 198 | var start, end bn254.G1Affine 199 | var ab, bExp big.Int 200 | a.ToBigIntRegular(&ab) 201 | exp.ToBigIntRegular(&bExp) 202 | start.ScalarMultiplication(&g1GenAff, &ab) 203 | 204 | gPoint, err := googleG1(&start) 205 | if err != nil { 206 | t.Log(err) 207 | return false 208 | } 209 | cPoint, err := cloudflareG1(&start) 210 | if err != nil { 211 | t.Log(err) 212 | return false 213 | } 214 | 215 | // perform the scalar multiplications 216 | gPoint.ScalarMult(gPoint, &bExp) 217 | cPoint.ScalarMult(cPoint, &bExp) 218 | end.ScalarMultiplication(&start, &bExp) 219 | 220 | if !(bytes.Equal(gPoint.Marshal(), end.Marshal())) { 221 | t.Log("scalar multiplication between google and gnark-crypto is different") 222 | return false 223 | } 224 | 225 | if !(bytes.Equal(cPoint.Marshal(), end.Marshal())) { 226 | t.Log("scalar multiplication between cloudflare and gnark-crypto is different") 227 | return false 228 | } 229 | return true 230 | }, 231 | genFp(), 232 | genFp(), 233 | )) 234 | 235 | properties.Property("[BN254] G2: scalarMultiplication interop", prop.ForAll( 236 | func(a, exp fp.Element) bool { 237 | var start, end bn254.G2Affine 238 | var ab, bExp big.Int 239 | a.ToBigIntRegular(&ab) 240 | exp.ToBigIntRegular(&bExp) 241 | start.ScalarMultiplication(&g2GenAff, &ab) 242 | 243 | gPoint, err := googleG2(&start) 244 | if err != nil { 245 | t.Log(err) 246 | return false 247 | } 248 | cPoint, err := cloudflareG2(&start) 249 | if err != nil { 250 | t.Log(err) 251 | return false 252 | } 253 | // perform the scalar multiplications 254 | gPoint.ScalarMult(gPoint, &bExp) 255 | cPoint.ScalarMult(cPoint, &bExp) 256 | end.ScalarMultiplication(&start, &bExp) 257 | 258 | if !(bytes.Equal(gPoint.Marshal(), end.Marshal())) { 259 | t.Log("scalar multiplication between google and gnark-crypto is different") 260 | return false 261 | } 262 | 263 | if !(bytes.Equal(cPoint.Marshal(), end.Marshal())) { 264 | t.Log("scalar multiplication between cloudflare and gnark-crypto is different") 265 | return false 266 | } 267 | return true 268 | }, 269 | genFp(), 270 | genFp(), 271 | )) 272 | properties.TestingRun(t, gopter.ConsoleReporter(false)) 273 | } 274 | 275 | func TestPointAdditionInterop(t *testing.T) { 276 | parameters := gopter.DefaultTestParameters() 277 | parameters.MinSuccessfulTests = 100 278 | 279 | properties := gopter.NewProperties(parameters) 280 | 281 | properties.Property("[BN254] checking point addition", prop.ForAll( 282 | func(a fp.Element) bool { 283 | var g1 bn254.G1Affine 284 | var g2 bn254.G2Affine 285 | var ab big.Int 286 | a.ToBigIntRegular(&ab) 287 | g1.ScalarMultiplication(&g1GenAff, &ab) 288 | g2.ScalarMultiplication(&g2GenAff, &ab) 289 | 290 | // do the same with google and cloud flare 291 | g1g, err := googleG1(&g1) 292 | if err != nil { 293 | t.Log(err) 294 | return false 295 | } 296 | g1c, err := cloudflareG1(&g1) 297 | if err != nil { 298 | t.Log(err) 299 | return false 300 | } 301 | g2g, err := googleG2(&g2) 302 | if err != nil { 303 | t.Log(err) 304 | return false 305 | } 306 | g2c, err := cloudflareG2(&g2) 307 | if err != nil { 308 | t.Log(err) 309 | return false 310 | } 311 | g1gGen, err := googleG1(&g1GenAff) 312 | if err != nil { 313 | t.Log(err) 314 | return false 315 | } 316 | g1cGen, err := cloudflareG1(&g1GenAff) 317 | if err != nil { 318 | t.Log(err) 319 | return false 320 | } 321 | g2gGen, err := googleG2(&g2GenAff) 322 | if err != nil { 323 | t.Log(err) 324 | return false 325 | } 326 | g2cGen, err := cloudflareG2(&g2GenAff) 327 | if err != nil { 328 | t.Log(err) 329 | return false 330 | } 331 | 332 | // add g1 to g1Gen and g2 to g2gen 333 | var _g1 bn254.G1Jac 334 | var _g2 bn254.G2Jac 335 | _g1.FromAffine(&g1) 336 | _g2.FromAffine(&g2) 337 | 338 | _g1.AddAssign(&g1Gen) 339 | g1.FromJacobian(&_g1) 340 | 341 | _g2.AddAssign(&g2Gen) 342 | g2.FromJacobian(&_g2) 343 | 344 | // results 345 | g1c.Add(g1c, g1cGen) 346 | g1g.Add(g1g, g1gGen) 347 | g2c.Add(g2c, g2cGen) 348 | g2g.Add(g2g, g2gGen) 349 | 350 | if !(bytes.Equal(g1.Marshal(), g1c.Marshal())) { 351 | t.Log("g1 point addition doesn't match google implementation") 352 | return false 353 | } 354 | 355 | if !(bytes.Equal(g1.Marshal(), g1g.Marshal())) { 356 | t.Log("g1 point addition doesn't match cloudflare implementation") 357 | return false 358 | } 359 | 360 | if !(bytes.Equal(g2.Marshal(), g2c.Marshal())) { 361 | t.Log("g2 point addition doesn't match google implementation") 362 | return false 363 | } 364 | 365 | if !(bytes.Equal(g2.Marshal(), g2g.Marshal())) { 366 | t.Log("g2 point addition doesn't match cloudflare implementation") 367 | return false 368 | } 369 | 370 | return true 371 | }, 372 | genFp(), 373 | )) 374 | 375 | properties.TestingRun(t, gopter.ConsoleReporter(false)) 376 | } 377 | 378 | func TestPairingInterop(t *testing.T) { 379 | parameters := gopter.DefaultTestParameters() 380 | parameters.MinSuccessfulTests = 100 381 | 382 | properties := gopter.NewProperties(parameters) 383 | 384 | properties.Property("[BN254] pairing check interop", prop.ForAll( 385 | func(a fp.Element) bool { 386 | var g1 bn254.G1Affine 387 | var g2 bn254.G2Affine 388 | var ab big.Int 389 | a.ToBigIntRegular(&ab) 390 | g1.ScalarMultiplication(&g1GenAff, &ab) 391 | g2.ScalarMultiplication(&g2GenAff, &ab) 392 | 393 | g1g, err := googleG1(&g1) 394 | if err != nil { 395 | t.Log(err) 396 | return false 397 | } 398 | g2g, err := googleG2(&g2) 399 | if err != nil { 400 | t.Log(err) 401 | return false 402 | } 403 | 404 | g1c, err := cloudflareG1(&g1) 405 | if err != nil { 406 | t.Log(err) 407 | return false 408 | } 409 | g2c, err := cloudflareG2(&g2) 410 | if err != nil { 411 | t.Log(err) 412 | return false 413 | } 414 | 415 | // pairings 416 | pc := cloudflare.Pair(g1c, g2c) 417 | gc := google.Pair(g1g, g2g) 418 | c, _ := bn254.Pair([]bn254.G1Affine{g1}, []bn254.G2Affine{g2}) 419 | 420 | if !(bytes.Equal(c.Marshal(), gc.Marshal())) { 421 | t.Log("pairing doesn't match google implementation") 422 | return false 423 | } 424 | 425 | if !(bytes.Equal(c.Marshal(), pc.Marshal())) { 426 | t.Log("pairing doesn't match cloudflare implementation") 427 | return false 428 | } 429 | 430 | return true 431 | }, 432 | genFp(), 433 | )) 434 | 435 | properties.TestingRun(t, gopter.ConsoleReporter(false)) 436 | } 437 | 438 | func BenchmarkPairingInteropBN254(b *testing.B) { 439 | var g1 bn254.G1Affine 440 | var g2 bn254.G2Affine 441 | var ab big.Int 442 | ab.SetUint64(42) 443 | g1.ScalarMultiplication(&g1GenAff, &ab) 444 | g2.ScalarMultiplication(&g2GenAff, &ab) 445 | 446 | b.Run("[bn254]google_pairing", func(b *testing.B) { 447 | g1g, err := googleG1(&g1) 448 | if err != nil { 449 | b.Fatal(err) 450 | } 451 | g2g, err := googleG2(&g2) 452 | if err != nil { 453 | b.Fatal(err) 454 | } 455 | b.ResetTimer() 456 | for i := 0; i < b.N; i++ { 457 | _ = google.Pair(g1g, g2g) 458 | } 459 | }) 460 | b.Run("[bn254]cloudflare_pairing", func(b *testing.B) { 461 | g1c, err := cloudflareG1(&g1) 462 | if err != nil { 463 | b.Fatal(err) 464 | } 465 | g2c, err := cloudflareG2(&g2) 466 | if err != nil { 467 | b.Fatal(err) 468 | } 469 | b.ResetTimer() 470 | for i := 0; i < b.N; i++ { 471 | _ = cloudflare.Pair(g1c, g2c) 472 | } 473 | }) 474 | 475 | b.Run("[bn254]gnark-crypto_pairing", func(b *testing.B) { 476 | b.ResetTimer() 477 | for i := 0; i < b.N; i++ { 478 | _, _ = bn254.Pair([]bn254.G1Affine{g1}, []bn254.G2Affine{g2}) 479 | } 480 | }) 481 | 482 | } 483 | 484 | func BenchmarkPointAdditionInteropBN254(b *testing.B) { 485 | var g1 bn254.G1Affine 486 | var ab big.Int 487 | ab.SetUint64(42) 488 | g1.ScalarMultiplication(&g1GenAff, &ab) 489 | 490 | b.Run("[bn254]cloudflare_add_jacobian", func(b *testing.B) { 491 | g1g, err := cloudflareG1(&g1) 492 | if err != nil { 493 | b.Fatal(err) 494 | } 495 | g1gen, err := cloudflareG1(&g1GenAff) 496 | if err != nil { 497 | b.Fatal(err) 498 | } 499 | b.ResetTimer() 500 | for i := 0; i < b.N; i++ { 501 | g1g.Add(g1g, g1gen) 502 | } 503 | }) 504 | 505 | b.Run("[bn254]gnark-crypto_add_jacobian", func(b *testing.B) { 506 | b.ResetTimer() 507 | for i := 0; i < b.N; i++ { 508 | var _g1 bn254.G1Jac 509 | _g1.FromAffine(&g1) 510 | _g1.AddAssign(&g1Gen) 511 | } 512 | }) 513 | 514 | } 515 | 516 | func cloudflareG1(p *bn254.G1Affine) (*cloudflare.G1, error) { 517 | r := new(cloudflare.G1) 518 | if _, err := r.Unmarshal(p.Marshal()); err != nil { 519 | return nil, err 520 | } 521 | return r, nil 522 | } 523 | 524 | func cloudflareG2(p *bn254.G2Affine) (*cloudflare.G2, error) { 525 | r := new(cloudflare.G2) 526 | if _, err := r.Unmarshal(p.Marshal()); err != nil { 527 | return nil, err 528 | } 529 | return r, nil 530 | } 531 | 532 | func googleG1(p *bn254.G1Affine) (*google.G1, error) { 533 | r := new(google.G1) 534 | if _, err := r.Unmarshal(p.Marshal()); err != nil { 535 | return nil, err 536 | } 537 | return r, nil 538 | } 539 | 540 | func googleG2(p *bn254.G2Affine) (*google.G2, error) { 541 | r := new(google.G2) 542 | if _, err := r.Unmarshal(p.Marshal()); err != nil { 543 | return nil, err 544 | } 545 | return r, nil 546 | } 547 | 548 | func genFp() gopter.Gen { 549 | return func(genParams *gopter.GenParameters) *gopter.GenResult { 550 | var elmt fp.Element 551 | var b [fp.Bytes]byte 552 | rand.Read(b[:]) 553 | elmt.SetBytes(b[:]) 554 | genResult := gopter.NewGenResult(elmt, gopter.NoShrinker) 555 | return genResult 556 | } 557 | } 558 | 559 | func genGT() gopter.Gen { 560 | return gopter.CombineGens( 561 | genFp(), 562 | genFp(), 563 | genFp(), 564 | genFp(), 565 | genFp(), 566 | genFp(), 567 | genFp(), 568 | genFp(), 569 | genFp(), 570 | genFp(), 571 | genFp(), 572 | genFp(), 573 | ).Map(func(values []interface{}) *bn254.GT { 574 | var b [fp.Bytes * 12]byte 575 | rand.Read(b[:]) 576 | var r bn254.GT 577 | offset := 0 578 | r.C0.B0.A0.SetBytes(b[offset : offset+fp.Bytes]) 579 | offset += fp.Bytes 580 | r.C0.B0.A1.SetBytes(b[offset : offset+fp.Bytes]) 581 | offset += fp.Bytes 582 | r.C0.B1.A0.SetBytes(b[offset : offset+fp.Bytes]) 583 | offset += fp.Bytes 584 | r.C0.B1.A1.SetBytes(b[offset : offset+fp.Bytes]) 585 | offset += fp.Bytes 586 | r.C0.B2.A0.SetBytes(b[offset : offset+fp.Bytes]) 587 | offset += fp.Bytes 588 | r.C0.B2.A1.SetBytes(b[offset : offset+fp.Bytes]) 589 | offset += fp.Bytes 590 | 591 | r.C1.B0.A0.SetBytes(b[offset : offset+fp.Bytes]) 592 | offset += fp.Bytes 593 | r.C1.B0.A1.SetBytes(b[offset : offset+fp.Bytes]) 594 | offset += fp.Bytes 595 | r.C1.B1.A0.SetBytes(b[offset : offset+fp.Bytes]) 596 | offset += fp.Bytes 597 | r.C1.B1.A1.SetBytes(b[offset : offset+fp.Bytes]) 598 | offset += fp.Bytes 599 | r.C1.B2.A0.SetBytes(b[offset : offset+fp.Bytes]) 600 | offset += fp.Bytes 601 | r.C1.B2.A1.SetBytes(b[offset : offset+fp.Bytes]) 602 | offset += fp.Bytes 603 | 604 | return &r 605 | }) 606 | } 607 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/consensys/gnark-tests 2 | 3 | go 1.19 4 | 5 | require ( 6 | github.com/consensys/gnark v0.7.2-0.20230620210714-0713c1dc4def 7 | github.com/consensys/gnark-crypto v0.11.1-0.20230609175512-0ee617fa6d43 8 | github.com/ethereum/go-ethereum v1.12.0 9 | github.com/kilic/bls12-381 v0.1.0 10 | github.com/leanovate/gopter v0.2.9 11 | github.com/stretchr/testify v1.8.2 12 | ) 13 | 14 | require ( 15 | github.com/DataDog/zstd v1.5.2 // indirect 16 | github.com/VictoriaMetrics/fastcache v1.10.0 // indirect 17 | github.com/beorn7/perks v1.0.1 // indirect 18 | github.com/bits-and-blooms/bitset v1.7.0 // indirect 19 | github.com/blang/semver/v4 v4.0.0 // indirect 20 | github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect 21 | github.com/cespare/xxhash/v2 v2.2.0 // indirect 22 | github.com/cockroachdb/errors v1.9.1 // indirect 23 | github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect 24 | github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 // indirect 25 | github.com/cockroachdb/redact v1.1.3 // indirect 26 | github.com/consensys/bavard v0.1.13 // indirect 27 | github.com/davecgh/go-spew v1.1.1 // indirect 28 | github.com/deckarep/golang-set/v2 v2.1.0 // indirect 29 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect 30 | github.com/fsnotify/fsnotify v1.6.0 // indirect 31 | github.com/fxamacker/cbor/v2 v2.4.0 // indirect 32 | github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect 33 | github.com/getsentry/sentry-go v0.18.0 // indirect 34 | github.com/go-ole/go-ole v1.2.6 // indirect 35 | github.com/go-stack/stack v1.8.1 // indirect 36 | github.com/gofrs/flock v0.8.1 // indirect 37 | github.com/gogo/protobuf v1.3.2 // indirect 38 | github.com/golang/protobuf v1.5.2 // indirect 39 | github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect 40 | github.com/google/pprof v0.0.0-20230309165930-d61513b1440d // indirect 41 | github.com/google/uuid v1.3.0 // indirect 42 | github.com/gorilla/websocket v1.5.0 // indirect 43 | github.com/holiman/bloomfilter/v2 v2.0.3 // indirect 44 | github.com/holiman/uint256 v1.2.2 // indirect 45 | github.com/huin/goupnp v1.0.3 // indirect 46 | github.com/jackpal/go-nat-pmp v1.0.2 // indirect 47 | github.com/klauspost/compress v1.15.15 // indirect 48 | github.com/kr/pretty v0.3.1 // indirect 49 | github.com/kr/text v0.2.0 // indirect 50 | github.com/mattn/go-colorable v0.1.13 // indirect 51 | github.com/mattn/go-isatty v0.0.16 // indirect 52 | github.com/mattn/go-runewidth v0.0.13 // indirect 53 | github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect 54 | github.com/mmcloughlin/addchain v0.4.0 // indirect 55 | github.com/olekukonko/tablewriter v0.0.5 // indirect 56 | github.com/pkg/errors v0.9.1 // indirect 57 | github.com/pmezard/go-difflib v1.0.0 // indirect 58 | github.com/prometheus/client_golang v1.14.0 // indirect 59 | github.com/prometheus/client_model v0.3.0 // indirect 60 | github.com/prometheus/common v0.39.0 // indirect 61 | github.com/prometheus/procfs v0.9.0 // indirect 62 | github.com/rivo/uniseg v0.4.2 // indirect 63 | github.com/rogpeppe/go-internal v1.9.0 // indirect 64 | github.com/rs/zerolog v1.29.0 // indirect 65 | github.com/shirou/gopsutil v3.21.11+incompatible // indirect 66 | github.com/status-im/keycard-go v0.2.0 // indirect 67 | github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect 68 | github.com/tklauser/go-sysconf v0.3.10 // indirect 69 | github.com/tklauser/numcpus v0.5.0 // indirect 70 | github.com/tyler-smith/go-bip39 v1.1.0 // indirect 71 | github.com/x448/float16 v0.8.4 // indirect 72 | github.com/yusufpapurcu/wmi v1.2.2 // indirect 73 | golang.org/x/crypto v0.10.0 // indirect 74 | golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb // indirect 75 | golang.org/x/sync v0.1.0 // indirect 76 | golang.org/x/sys v0.9.0 // indirect 77 | golang.org/x/text v0.10.0 // indirect 78 | google.golang.org/protobuf v1.28.1 // indirect 79 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect 80 | gopkg.in/yaml.v3 v3.0.1 // indirect 81 | rsc.io/tmplfunc v0.0.3 // indirect 82 | ) 83 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= 3 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 4 | github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= 5 | github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= 6 | github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= 7 | github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= 8 | github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= 9 | github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= 10 | github.com/VictoriaMetrics/fastcache v1.10.0 h1:5hDJnLsKLpnUEToub7ETuRu8RCkb40woBZAUiKonXzY= 11 | github.com/VictoriaMetrics/fastcache v1.10.0/go.mod h1:tjiYeEfYXCqacuvYw/7UoDIeJaNxq6132xHICNP77w8= 12 | github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= 13 | github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= 14 | github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= 15 | github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= 16 | github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= 17 | github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 18 | github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= 19 | github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= 20 | github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= 21 | github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= 22 | github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= 23 | github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= 24 | github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= 25 | github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= 26 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 27 | github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= 28 | github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 29 | github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= 30 | github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 31 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 32 | github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= 33 | github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= 34 | github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= 35 | github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= 36 | github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= 37 | github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= 38 | github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= 39 | github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= 40 | github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 h1:ytcWPaNPhNoGMWEhDvS3zToKcDpRsLuRolQJBVGdozk= 41 | github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811/go.mod h1:Nb5lgvnQ2+oGlE/EyZy4+2/CxRh9KfvCXnag1vtpxVM= 42 | github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= 43 | github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= 44 | github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= 45 | github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= 46 | github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= 47 | github.com/consensys/gnark v0.7.2-0.20230620210338-5804a8651080 h1:ulnrEQDqaDyDDKHpORL+SlsndMTlmP6NlP4tW0PjgaA= 48 | github.com/consensys/gnark v0.7.2-0.20230620210338-5804a8651080/go.mod h1:rM1H8r55y324l7Bq4OCylpSBk4axrqXZoa1i9Y3e5qM= 49 | github.com/consensys/gnark v0.7.2-0.20230620210714-0713c1dc4def h1:St57JXPuBJ7iMNO0fmk/X5ui7XKAXgoEfienLR0d964= 50 | github.com/consensys/gnark v0.7.2-0.20230620210714-0713c1dc4def/go.mod h1:rM1H8r55y324l7Bq4OCylpSBk4axrqXZoa1i9Y3e5qM= 51 | github.com/consensys/gnark-crypto v0.11.1-0.20230609175512-0ee617fa6d43 h1:6VCNdjn2RmxgG2ZklMmSGov9BtCNfVF4VjqAngysiPU= 52 | github.com/consensys/gnark-crypto v0.11.1-0.20230609175512-0ee617fa6d43/go.mod h1:6C2ytC8zmP8uH2GKVfPOjf0Vw3KwMAaUxlCPK5WQqmw= 53 | github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= 54 | github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= 55 | github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 56 | github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= 57 | github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= 58 | github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= 59 | github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= 60 | github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 61 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 62 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 63 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 64 | github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= 65 | github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= 66 | github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= 67 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= 68 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= 69 | github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= 70 | github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= 71 | github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 72 | github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= 73 | github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 74 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 75 | github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= 76 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 77 | github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= 78 | github.com/ethereum/go-ethereum v1.12.0 h1:bdnhLPtqETd4m3mS8BGMNvBTf36bO5bx/hxE2zljOa0= 79 | github.com/ethereum/go-ethereum v1.12.0/go.mod h1:/oo2X/dZLJjf2mJ6YT9wcWxa4nNJDBKDBU6sFIpx1Gs= 80 | github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= 81 | github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= 82 | github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= 83 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 84 | github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= 85 | github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= 86 | github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= 87 | github.com/fxamacker/cbor/v2 v2.4.0 h1:ri0ArlOR+5XunOP8CRUowT0pSJOwhW098ZCUyskZD88= 88 | github.com/fxamacker/cbor/v2 v2.4.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= 89 | github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= 90 | github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= 91 | github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= 92 | github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= 93 | github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= 94 | github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= 95 | github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= 96 | github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= 97 | github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= 98 | github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= 99 | github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= 100 | github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= 101 | github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= 102 | github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= 103 | github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= 104 | github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= 105 | github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= 106 | github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= 107 | github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= 108 | github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= 109 | github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= 110 | github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= 111 | github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 112 | github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= 113 | github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 114 | github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= 115 | github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= 116 | github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= 117 | github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= 118 | github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= 119 | github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= 120 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 121 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 122 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 123 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 124 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 125 | github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 126 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 127 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 128 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 129 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 130 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 131 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= 132 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 133 | github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= 134 | github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= 135 | github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= 136 | github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 137 | github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= 138 | github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 139 | github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= 140 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 141 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 142 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 143 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 144 | github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 145 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 146 | github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= 147 | github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= 148 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 149 | github.com/google/pprof v0.0.0-20230309165930-d61513b1440d h1:um9/pc7tKMINFfP1eE7Wv6PRGXlcCSJkVajF7KJw3uQ= 150 | github.com/google/pprof v0.0.0-20230309165930-d61513b1440d/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= 151 | github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= 152 | github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 153 | github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= 154 | github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 155 | github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= 156 | github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 157 | github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= 158 | github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 159 | github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= 160 | github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= 161 | github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= 162 | github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= 163 | github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= 164 | github.com/holiman/uint256 v1.2.2 h1:TXKcSGc2WaxPD2+bmzAsVthL4+pEN0YwXcL5qED83vk= 165 | github.com/holiman/uint256 v1.2.2/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= 166 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 167 | github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= 168 | github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= 169 | github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= 170 | github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= 171 | github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= 172 | github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= 173 | github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= 174 | github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= 175 | github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= 176 | github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= 177 | github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= 178 | github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= 179 | github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= 180 | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 181 | github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 182 | github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 183 | github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= 184 | github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= 185 | github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= 186 | github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= 187 | github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= 188 | github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= 189 | github.com/kilic/bls12-381 v0.1.0 h1:encrdjqKMEvabVQ7qYOKu1OvhqpK4s47wDYtNiPtlp4= 190 | github.com/kilic/bls12-381 v0.1.0/go.mod h1:vDTTHJONJ6G+P2R74EhnyotQDTliQDnFEwhdmfzw1ig= 191 | github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= 192 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 193 | github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= 194 | github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= 195 | github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= 196 | github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= 197 | github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= 198 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 199 | github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= 200 | github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= 201 | github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 202 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 203 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 204 | github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 205 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 206 | github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= 207 | github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= 208 | github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= 209 | github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= 210 | github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= 211 | github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 212 | github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= 213 | github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= 214 | github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= 215 | github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= 216 | github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= 217 | github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= 218 | github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 219 | github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 220 | github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= 221 | github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= 222 | github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= 223 | github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= 224 | github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= 225 | github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 226 | github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= 227 | github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= 228 | github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= 229 | github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= 230 | github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= 231 | github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= 232 | github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= 233 | github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 234 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 235 | github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= 236 | github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= 237 | github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= 238 | github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= 239 | github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= 240 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 241 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 242 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 243 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 244 | github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= 245 | github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= 246 | github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= 247 | github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= 248 | github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= 249 | github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= 250 | github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= 251 | github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= 252 | github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= 253 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 254 | github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 255 | github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= 256 | github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= 257 | github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= 258 | github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= 259 | github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= 260 | github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= 261 | github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= 262 | github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= 263 | github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= 264 | github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= 265 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 266 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 267 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 268 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 269 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 270 | github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= 271 | github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= 272 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 273 | github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= 274 | github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= 275 | github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI= 276 | github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y= 277 | github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= 278 | github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= 279 | github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= 280 | github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8= 281 | github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= 282 | github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= 283 | github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= 284 | github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= 285 | github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= 286 | github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= 287 | github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= 288 | github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= 289 | github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= 290 | github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= 291 | github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= 292 | github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= 293 | github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= 294 | github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= 295 | github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= 296 | github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= 297 | github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= 298 | github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= 299 | github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= 300 | github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= 301 | github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= 302 | github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= 303 | github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= 304 | github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= 305 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 306 | github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= 307 | github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= 308 | github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= 309 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 310 | github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 311 | github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 312 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 313 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 314 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 315 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 316 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 317 | github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 318 | github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= 319 | github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= 320 | github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= 321 | github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= 322 | github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= 323 | github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= 324 | github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= 325 | github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= 326 | github.com/tklauser/numcpus v0.5.0 h1:ooe7gN0fg6myJ0EKoTAf5hebTZrH52px3New/D9iJ+A= 327 | github.com/tklauser/numcpus v0.5.0/go.mod h1:OGzpTxpcIMNGYQdit2BYL1pvk/dSOaJWjKoflh+RQjo= 328 | github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= 329 | github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= 330 | github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= 331 | github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= 332 | github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= 333 | github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= 334 | github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q= 335 | github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= 336 | github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= 337 | github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= 338 | github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= 339 | github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= 340 | github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= 341 | github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= 342 | github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= 343 | github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= 344 | github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= 345 | github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= 346 | github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= 347 | github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= 348 | github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= 349 | github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= 350 | github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= 351 | github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= 352 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 353 | github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 354 | github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 355 | github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= 356 | github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= 357 | golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 358 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 359 | golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 360 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 361 | golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 362 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 363 | golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= 364 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 365 | golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= 366 | golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= 367 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 368 | golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb h1:PaBZQdo+iSDyHT053FjUCgZQ/9uqVwPOcl7KSWhKn6w= 369 | golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= 370 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 371 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 372 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 373 | golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 374 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 375 | golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 376 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 377 | golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 378 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 379 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 380 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 381 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 382 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 383 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 384 | golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 385 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 386 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 387 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 388 | golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 389 | golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 390 | golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 391 | golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 392 | golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 393 | golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 394 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 395 | golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= 396 | golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 397 | golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= 398 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 399 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 400 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 401 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 402 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 403 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 404 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 405 | golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 406 | golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 407 | golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= 408 | golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 409 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 410 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 411 | golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 412 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 413 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 414 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 415 | golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 416 | golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 417 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 418 | golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 419 | golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 420 | golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 421 | golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 422 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 423 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 424 | golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 425 | golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 426 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 427 | golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 428 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 429 | golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 430 | golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 431 | golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 432 | golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 433 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 434 | golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 435 | golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 436 | golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 437 | golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 438 | golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 439 | golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 440 | golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 441 | golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 442 | golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 443 | golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= 444 | golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 445 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 446 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 447 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 448 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 449 | golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 450 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 451 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= 452 | golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= 453 | golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= 454 | golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 455 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 456 | golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 457 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 458 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 459 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 460 | golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 461 | golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 462 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 463 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 464 | golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 465 | golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 466 | golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 467 | golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 468 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 469 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 470 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 471 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 472 | golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= 473 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 474 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 475 | google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 476 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 477 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 478 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= 479 | google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= 480 | google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= 481 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 482 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 483 | google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= 484 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 485 | google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= 486 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 487 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 488 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 489 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 490 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 491 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 492 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 493 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 494 | google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 495 | google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= 496 | google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= 497 | google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= 498 | google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 499 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 500 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 501 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 502 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= 503 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 504 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 505 | gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= 506 | gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= 507 | gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= 508 | gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= 509 | gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= 510 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= 511 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= 512 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= 513 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 514 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 515 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 516 | gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 517 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 518 | gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 519 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 520 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 521 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 522 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 523 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 524 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 525 | rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= 526 | rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= 527 | -------------------------------------------------------------------------------- /solidity/abi/PlonkVerifier.abi: -------------------------------------------------------------------------------- 1 | [{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"a","type":"uint256"}],"name":"PrintUint256","type":"event"}] -------------------------------------------------------------------------------- /solidity/abi/Utils.abi: -------------------------------------------------------------------------------- 1 | [{"inputs":[{"internalType":"uint256","name":"x","type":"uint256"},{"internalType":"uint256","name":"y","type":"uint256"}],"name":"expand_msg","outputs":[{"internalType":"uint8[48]","name":"res","type":"uint8[48]"}],"stateMutability":"pure","type":"function"}] -------------------------------------------------------------------------------- /solidity/abi/combined.json: -------------------------------------------------------------------------------- 1 | {"contracts":{"contract_g16.sol:Pairing":{"abi":[],"bin":"60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220653eb494049b9b308053568d36c9b4770a8277380c3c26263e1db4f63530da4b64736f6c63430008140033"},"contract_g16.sol:Verifier":{"abi":[{"inputs":[{"internalType":"uint256[2]","name":"a","type":"uint256[2]"},{"internalType":"uint256[2][2]","name":"b","type":"uint256[2][2]"},{"internalType":"uint256[2]","name":"c","type":"uint256[2]"},{"internalType":"uint256[1]","name":"input","type":"uint256[1]"}],"name":"verifyProof","outputs":[{"internalType":"bool","name":"r","type":"bool"}],"stateMutability":"view","type":"function"}],"bin":"608060405234801561001057600080fd5b50611b8d806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c806343753b4d14610030575b600080fd5b61004a600480360381019061004591906113e7565b610060565b604051610057919061146b565b60405180910390f35b600061006a61104d565b60405180604001604052808760006002811061008957610088611486565b5b60200201518152602001876001600281106100a7576100a6611486565b5b6020020151815250816000018190525060405180604001604052806040518060400160405280886000600281106100e1576100e0611486565b5b60200201516000600281106100f9576100f8611486565b5b602002015181526020018860006002811061011757610116611486565b5b602002015160016002811061012f5761012e611486565b5b6020020151815250815260200160405180604001604052808860016002811061015b5761015a611486565b5b602002015160006002811061017357610172611486565b5b602002015181526020018860016002811061019157610190611486565b5b60200201516001600281106101a9576101a8611486565b5b602002015181525081525081602001819052506040518060400160405280856000600281106101db576101da611486565b5b60200201518152602001856001600281106101f9576101f8611486565b5b602002015181525081604001819052507f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4781600001516000015110610273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026a90611512565b60405180910390fd5b7f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47816000015160200151106102dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102d49061157e565b60405180910390fd5b7f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4781602001516000015160006002811061031a57610319611486565b5b60200201511061035f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610356906115ea565b60405180910390fd5b7f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4781602001516020015160006002811061039c5761039b611486565b5b6020020151106103e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103d890611656565b60405180910390fd5b7f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4781602001516000015160016002811061041e5761041d611486565b5b602002015110610463576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045a906116c2565b60405180910390fd5b7f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd478160200151602001516001600281106104a05761049f611486565b5b6020020151106104e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104dc9061172e565b60405180910390fd5b7f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd478160400151600001511061054f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105469061179a565b60405180910390fd5b7f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47816040015160200151106105b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b090611806565b60405180910390fd5b60005b6001811015610651577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018482600181106105f9576105f8611486565b5b60200201351061063e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063590611872565b60405180910390fd5b8080610649906118c1565b9150506105bc565b50600061065c6107fa565b9050600060405180604001604052806000815260200160008152509050610681611080565b6106896110a2565b6000604051806040016040528060008152602001600081525090507f03fe0f0f54e065a5130be0aa940ea4af65af923fce32acf91412e121099a54778460000181815250507f0fca6c1c027894a0d98b8d7d088e0e3181d611ae6812949642724c05d947e3698460200181815250507f27d19f97459984392857387cda5ee3fa2a2849a81a29e2c3b264ed2f21f56e348260006003811061072d5761072c611486565b5b6020020181815250507f1fe3d55447d38ec20e88783e4659550ef753a257de657448997892feac4d2aaf8260016003811061076b5761076a611486565b5b6020020181815250508760006001811061078857610787611486565b5b6020020135826002600381106107a1576107a0611486565b5b6020020181815250506107b682828587610ab1565b6107ea6107c68760000151610b53565b876020015187600001518860200151888a604001518c604001518c60600151610c11565b9650505050505050949350505050565b6108026110c4565b60405180604001604052807f0743d7f3134a290634e86c04bb7f9d09d631e14719910688dce25dd95c99836a81526020017f261cc6c4b9b9fd2fb1f606c9665afae75038988694ac3bd36c39af77dfc77ba88152508160000181905250604051806040016040528060405180604001604052807f0a8cc084cbceb7d88ec7ae84e69183e2bd79ab49ebb180fc233adc719761284081526020017f16336420e93286a9473c0b72e90139b3c0773f5c39e69685f9c6edc3b3f09de8815250815260200160405180604001604052807f18a80286a4e541168dbecd4a912f2f6db2a2c7b42ffb50104646b14787362c9581526020017f255ddfe2e4dd69ab632579a6de4d3ba3884c35e2bb096bd2468d91988ba479308152508152508160200181905250604051806040016040528060405180604001604052807f1616509f6150ec81653a0d27eaaef0b6b9745de052fc243de102a9d9c1a0422f81526020017f0ab8f1eeef057065208057907fb52e0a8cf11baad74c47a7b610704b7dcb1fc9815250815260200160405180604001604052807f07ee35eaed3f371cdde9cae7e44e773bee503e70a90ef8049b15eca7f5b641af81526020017f0e52252b6fbf87717ff10225fbbc18963e4a8a94a9121ee855df4a89f4fea7128152508152508160400181905250604051806040016040528060405180604001604052807f2287c0c1c8f72b87ca97a138780e394c809896de08bd39b68653d7e28ae8ddf281526020017f061b45ebaa849013901cb86573900c837b2f63ca5bcd298f007ac27dff925f65815250815260200160405180604001604052807f1bfac7e3d4f3ff8e4ba5f5be25130bdfb8d985bf3d2cd8d8165f3b7b1505882d81526020017f1a9d78a44239e4f26134dcc9f91865de5abbf40b8de6998e90d8d1b71553819d815250815250816060018190525090565b610abb8484610f87565b806000015182600060048110610ad457610ad3611486565b5b602002018181525050806020015182600160048110610af657610af5611486565b5b602002018181525050826000015182600260048110610b1857610b17611486565b5b602002018181525050826020015182600360048110610b3a57610b39611486565b5b602002018181525050610b4d8282610fea565b50505050565b610b5b611104565b60008260000151148015610b73575060008260200151145b15610b965760405180604001604052806000815260200160008152509050610c0c565b6040518060400160405280836000015181526020017f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd478460200151610bdb9190611938565b7f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47610c069190611969565b81525090505b919050565b60008060405180608001604052808b8152602001898152602001878152602001858152509050600060405180608001604052808b815260200189815260200187815260200185815250905060006018905060008167ffffffffffffffff811115610c7e57610c7d6111ad565b5b604051908082528060200260200182016040528015610cac5781602001602082028036833780820191505090505b50905060005b6004811015610eea576000600682610cca919061199d565b9050858260048110610cdf57610cde611486565b5b60200201516000015183600083610cf691906119df565b81518110610d0757610d06611486565b5b602002602001018181525050858260048110610d2657610d25611486565b5b60200201516020015183600183610d3d91906119df565b81518110610d4e57610d4d611486565b5b602002602001018181525050848260048110610d6d57610d6c611486565b5b602002015160000151600060028110610d8957610d88611486565b5b602002015183600283610d9c91906119df565b81518110610dad57610dac611486565b5b602002602001018181525050848260048110610dcc57610dcb611486565b5b602002015160000151600160028110610de857610de7611486565b5b602002015183600383610dfb91906119df565b81518110610e0c57610e0b611486565b5b602002602001018181525050848260048110610e2b57610e2a611486565b5b602002015160200151600060028110610e4757610e46611486565b5b602002015183600483610e5a91906119df565b81518110610e6b57610e6a611486565b5b602002602001018181525050848260048110610e8a57610e89611486565b5b602002015160200151600160028110610ea657610ea5611486565b5b602002015183600583610eb991906119df565b81518110610eca57610ec9611486565b5b602002602001018181525050508080610ee2906118c1565b915050610cb2565b50610ef361111e565b6000602082602086026020860160086107d05a03fa90508060008103610f1557fe5b5080610f56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4d90611a5f565b60405180910390fd5b600082600060018110610f6c57610f6b611486565b5b60200201511415965050505050505098975050505050505050565b600060608260808560076107d05a03fa90508060008103610fa457fe5b5080610fe5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fdc90611acb565b60405180910390fd5b505050565b600060608260c08560066107d05a03fa9050806000810361100757fe5b5080611048576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103f90611b37565b60405180910390fd5b505050565b6040518060600160405280611060611104565b815260200161106d611140565b815260200161107a611104565b81525090565b6040518060800160405280600490602082028036833780820191505090505090565b6040518060600160405280600390602082028036833780820191505090505090565b60405180608001604052806110d7611104565b81526020016110e4611140565b81526020016110f1611140565b81526020016110fe611140565b81525090565b604051806040016040528060008152602001600081525090565b6040518060200160405280600190602082028036833780820191505090505090565b6040518060400160405280611153611166565b8152602001611160611166565b81525090565b6040518060400160405280600290602082028036833780820191505090505090565b6000604051905090565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6111e58261119c565b810181811067ffffffffffffffff82111715611204576112036111ad565b5b80604052505050565b6000611217611188565b905061122382826111dc565b919050565b600067ffffffffffffffff821115611243576112426111ad565b5b602082029050919050565b600080fd5b6000819050919050565b61126681611253565b811461127157600080fd5b50565b6000813590506112838161125d565b92915050565b600061129c61129784611228565b61120d565b905080602084028301858111156112b6576112b561124e565b5b835b818110156112df57806112cb8882611274565b8452602084019350506020810190506112b8565b5050509392505050565b600082601f8301126112fe576112fd611197565b5b600261130b848285611289565b91505092915050565b600067ffffffffffffffff82111561132f5761132e6111ad565b5b602082029050919050565b600061134d61134884611314565b61120d565b905080604084028301858111156113675761136661124e565b5b835b81811015611390578061137c88826112e9565b845260208401935050604081019050611369565b5050509392505050565b600082601f8301126113af576113ae611197565b5b60026113bc84828561133a565b91505092915050565b6000819050826020600102820111156113e1576113e061124e565b5b92915050565b600080600080610120858703121561140257611401611192565b5b6000611410878288016112e9565b94505060406114218782880161139a565b93505060c0611432878288016112e9565b925050610100611444878288016113c5565b91505092959194509250565b60008115159050919050565b61146581611450565b82525050565b6000602082019050611480600083018461145c565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082825260208201905092915050565b7f76657269666965722d61582d6774652d7072696d652d71000000000000000000600082015250565b60006114fc6017836114b5565b9150611507826114c6565b602082019050919050565b6000602082019050818103600083015261152b816114ef565b9050919050565b7f76657269666965722d61592d6774652d7072696d652d71000000000000000000600082015250565b60006115686017836114b5565b915061157382611532565b602082019050919050565b600060208201905081810360008301526115978161155b565b9050919050565b7f76657269666965722d6258302d6774652d7072696d652d710000000000000000600082015250565b60006115d46018836114b5565b91506115df8261159e565b602082019050919050565b60006020820190508181036000830152611603816115c7565b9050919050565b7f76657269666965722d6259302d6774652d7072696d652d710000000000000000600082015250565b60006116406018836114b5565b915061164b8261160a565b602082019050919050565b6000602082019050818103600083015261166f81611633565b9050919050565b7f76657269666965722d6258312d6774652d7072696d652d710000000000000000600082015250565b60006116ac6018836114b5565b91506116b782611676565b602082019050919050565b600060208201905081810360008301526116db8161169f565b9050919050565b7f76657269666965722d6259312d6774652d7072696d652d710000000000000000600082015250565b60006117186018836114b5565b9150611723826116e2565b602082019050919050565b600060208201905081810360008301526117478161170b565b9050919050565b7f76657269666965722d63582d6774652d7072696d652d71000000000000000000600082015250565b60006117846017836114b5565b915061178f8261174e565b602082019050919050565b600060208201905081810360008301526117b381611777565b9050919050565b7f76657269666965722d63592d6774652d7072696d652d71000000000000000000600082015250565b60006117f06017836114b5565b91506117fb826117ba565b602082019050919050565b6000602082019050818103600083015261181f816117e3565b9050919050565b7f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c6400600082015250565b600061185c601f836114b5565b915061186782611826565b602082019050919050565b6000602082019050818103600083015261188b8161184f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006118cc82611253565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036118fe576118fd611892565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061194382611253565b915061194e83611253565b92508261195e5761195d611909565b5b828206905092915050565b600061197482611253565b915061197f83611253565b925082820390508181111561199757611996611892565b5b92915050565b60006119a882611253565b91506119b383611253565b92508282026119c181611253565b915082820484148315176119d8576119d7611892565b5b5092915050565b60006119ea82611253565b91506119f583611253565b9250828201905080821115611a0d57611a0c611892565b5b92915050565b7f70616972696e672d6f70636f64652d6661696c65640000000000000000000000600082015250565b6000611a496015836114b5565b9150611a5482611a13565b602082019050919050565b60006020820190508181036000830152611a7881611a3c565b9050919050565b7f70616972696e672d6d756c2d6661696c65640000000000000000000000000000600082015250565b6000611ab56012836114b5565b9150611ac082611a7f565b602082019050919050565b60006020820190508181036000830152611ae481611aa8565b9050919050565b7f70616972696e672d6164642d6661696c65640000000000000000000000000000600082015250565b6000611b216012836114b5565b9150611b2c82611aeb565b602082019050919050565b60006020820190508181036000830152611b5081611b14565b905091905056fea2646970667358221220428b7685484b6b46a252b7bbf9ce452b8927d2f2e7d49baa2992cb75bfb24c4964736f6c63430008140033"}},"version":"0.8.20+commit.a1b79de6.Darwin.appleclang"} -------------------------------------------------------------------------------- /solidity/contract/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "os" 6 | 7 | "github.com/consensys/gnark-crypto/ecc" 8 | "github.com/consensys/gnark/backend/groth16" 9 | "github.com/consensys/gnark/backend/plonk" 10 | "github.com/consensys/gnark/examples/cubic" 11 | "github.com/consensys/gnark/frontend" 12 | "github.com/consensys/gnark/frontend/cs/r1cs" 13 | "github.com/consensys/gnark/frontend/cs/scs" 14 | "github.com/consensys/gnark/test" 15 | ) 16 | 17 | func main() { 18 | err := generateGroth16() 19 | if err != nil { 20 | log.Fatal("groth16 error:", err) 21 | } 22 | 23 | err = generatePlonk() 24 | if err != nil { 25 | log.Fatal("plonk error:", err) 26 | } 27 | } 28 | 29 | func generateGroth16() error { 30 | var circuit cubic.Circuit 31 | 32 | r1cs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit) 33 | if err != nil { 34 | return err 35 | } 36 | 37 | pk, vk, err := groth16.Setup(r1cs) 38 | if err != nil { 39 | return err 40 | } 41 | { 42 | f, err := os.Create("cubic.g16.vk") 43 | if err != nil { 44 | return err 45 | } 46 | _, err = vk.WriteRawTo(f) 47 | if err != nil { 48 | return err 49 | } 50 | } 51 | { 52 | f, err := os.Create("cubic.g16.pk") 53 | if err != nil { 54 | return err 55 | } 56 | _, err = pk.WriteRawTo(f) 57 | if err != nil { 58 | return err 59 | } 60 | } 61 | 62 | { 63 | f, err := os.Create("contract_g16.sol") 64 | if err != nil { 65 | return err 66 | } 67 | err = vk.ExportSolidity(f) 68 | if err != nil { 69 | return err 70 | } 71 | } 72 | return nil 73 | } 74 | 75 | func generatePlonk() error { 76 | var circuit cubic.Circuit 77 | 78 | scs, err := frontend.Compile(ecc.BN254.ScalarField(), scs.NewBuilder, &circuit) 79 | if err != nil { 80 | return err 81 | } 82 | 83 | srs, err := test.NewKZGSRS(scs) 84 | if err != nil { 85 | return err 86 | } 87 | 88 | pk, vk, err := plonk.Setup(scs, srs) 89 | if err != nil { 90 | return err 91 | } 92 | { 93 | f, err := os.Create("cubic.plonk.vk") 94 | if err != nil { 95 | return err 96 | } 97 | _, err = vk.WriteTo(f) 98 | if err != nil { 99 | return err 100 | } 101 | } 102 | { 103 | f, err := os.Create("cubic.plonk.pk") 104 | if err != nil { 105 | return err 106 | } 107 | _, err = pk.WriteTo(f) 108 | if err != nil { 109 | return err 110 | } 111 | } 112 | 113 | { 114 | f, err := os.Create("contract_plonk.sol") 115 | if err != nil { 116 | return err 117 | } 118 | err = vk.ExportSolidity(f) 119 | if err != nil { 120 | return err 121 | } 122 | } 123 | return nil 124 | } 125 | -------------------------------------------------------------------------------- /solidity/generate.go: -------------------------------------------------------------------------------- 1 | package solidity 2 | 3 | //go:generate go run contract/main.go 4 | //go:generate solc --evm-version paris --combined-json abi,bin contract_plonk.sol -o abi --overwrite 5 | //go:generate abigen --combined-json abi/combined.json --pkg solidity --out solidity_plonk.go 6 | //go:generate solc --evm-version paris --combined-json abi,bin contract_g16.sol -o abi --overwrite 7 | //go:generate abigen --combined-json abi/combined.json --pkg solidity --out solidity_groth16.go 8 | -------------------------------------------------------------------------------- /solidity/solidity_groth16_test.go: -------------------------------------------------------------------------------- 1 | package solidity 2 | 3 | import ( 4 | "bytes" 5 | "math/big" 6 | "os" 7 | "testing" 8 | 9 | "github.com/consensys/gnark-crypto/ecc" 10 | "github.com/consensys/gnark/backend/groth16" 11 | "github.com/consensys/gnark/constraint" 12 | "github.com/consensys/gnark/examples/cubic" 13 | "github.com/consensys/gnark/frontend" 14 | "github.com/consensys/gnark/frontend/cs/r1cs" 15 | "github.com/ethereum/go-ethereum/accounts/abi/bind" 16 | "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" 17 | "github.com/ethereum/go-ethereum/common" 18 | "github.com/ethereum/go-ethereum/core" 19 | "github.com/ethereum/go-ethereum/crypto" 20 | "github.com/stretchr/testify/suite" 21 | ) 22 | 23 | type ExportSolidityTestSuiteGroth16 struct { 24 | suite.Suite 25 | 26 | // backend 27 | backend *backends.SimulatedBackend 28 | 29 | // verifier contract 30 | verifierContract *Verifier 31 | 32 | // groth16 gnark objects 33 | vk groth16.VerifyingKey 34 | pk groth16.ProvingKey 35 | circuit cubic.Circuit 36 | r1cs constraint.ConstraintSystem 37 | } 38 | 39 | func TestRunExportSolidityTestSuiteGroth16(t *testing.T) { 40 | suite.Run(t, new(ExportSolidityTestSuiteGroth16)) 41 | } 42 | 43 | func (t *ExportSolidityTestSuiteGroth16) SetupTest() { 44 | 45 | const gasLimit uint64 = 4712388 46 | 47 | // setup simulated backend 48 | key, _ := crypto.GenerateKey() 49 | auth, err := bind.NewKeyedTransactorWithChainID(key, big.NewInt(1337)) 50 | t.NoError(err, "init keyed transactor") 51 | 52 | genesis := map[common.Address]core.GenesisAccount{ 53 | auth.From: {Balance: big.NewInt(1000000000000000000)}, // 1 Eth 54 | } 55 | t.backend = backends.NewSimulatedBackend(genesis, gasLimit) 56 | 57 | // deploy verifier contract 58 | _, _, v, err := DeployVerifier(auth, t.backend) 59 | t.NoError(err, "deploy verifier contract failed") 60 | t.verifierContract = v 61 | t.backend.Commit() 62 | 63 | t.r1cs, err = frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &t.circuit) 64 | t.NoError(err, "compiling R1CS failed") 65 | 66 | // read proving and verifying keys 67 | t.pk = groth16.NewProvingKey(ecc.BN254) 68 | { 69 | f, _ := os.Open("cubic.g16.pk") 70 | _, err = t.pk.ReadFrom(f) 71 | f.Close() 72 | t.NoError(err, "reading proving key failed") 73 | } 74 | t.vk = groth16.NewVerifyingKey(ecc.BN254) 75 | { 76 | f, _ := os.Open("cubic.g16.vk") 77 | _, err = t.vk.ReadFrom(f) 78 | f.Close() 79 | t.NoError(err, "reading verifying key failed") 80 | } 81 | 82 | } 83 | 84 | func (t *ExportSolidityTestSuiteGroth16) TestVerifyProof() { 85 | 86 | // create a valid proof 87 | var assignment cubic.Circuit 88 | assignment.X = 3 89 | assignment.Y = 35 90 | 91 | // witness creation 92 | witness, err := frontend.NewWitness(&assignment, ecc.BN254.ScalarField()) 93 | t.NoError(err, "witness creation failed") 94 | 95 | // prove 96 | proof, err := groth16.Prove(t.r1cs, t.pk, witness) 97 | t.NoError(err, "proving failed") 98 | 99 | // ensure gnark (Go) code verifies it 100 | publicWitness, _ := witness.Public() 101 | err = groth16.Verify(proof, t.vk, publicWitness) 102 | t.NoError(err, "verifying failed") 103 | 104 | // get proof bytes 105 | const fpSize = 4 * 8 106 | var buf bytes.Buffer 107 | proof.WriteRawTo(&buf) 108 | proofBytes := buf.Bytes() 109 | 110 | // solidity contract inputs 111 | var ( 112 | a [2]*big.Int 113 | b [2][2]*big.Int 114 | c [2]*big.Int 115 | input [1]*big.Int 116 | ) 117 | 118 | // proof.Ar, proof.Bs, proof.Krs 119 | a[0] = new(big.Int).SetBytes(proofBytes[fpSize*0 : fpSize*1]) 120 | a[1] = new(big.Int).SetBytes(proofBytes[fpSize*1 : fpSize*2]) 121 | b[0][0] = new(big.Int).SetBytes(proofBytes[fpSize*2 : fpSize*3]) 122 | b[0][1] = new(big.Int).SetBytes(proofBytes[fpSize*3 : fpSize*4]) 123 | b[1][0] = new(big.Int).SetBytes(proofBytes[fpSize*4 : fpSize*5]) 124 | b[1][1] = new(big.Int).SetBytes(proofBytes[fpSize*5 : fpSize*6]) 125 | c[0] = new(big.Int).SetBytes(proofBytes[fpSize*6 : fpSize*7]) 126 | c[1] = new(big.Int).SetBytes(proofBytes[fpSize*7 : fpSize*8]) 127 | 128 | // public witness 129 | input[0] = new(big.Int).SetUint64(35) 130 | 131 | // call the contract 132 | res, err := t.verifierContract.VerifyProof(&bind.CallOpts{}, a, b, c, input) 133 | if t.NoError(err, "calling verifier on chain gave error") { 134 | t.True(res, "calling verifier on chain didn't succeed") 135 | } 136 | 137 | // (wrong) public witness 138 | input[0] = new(big.Int).SetUint64(42) 139 | 140 | // call the contract should fail 141 | res, err = t.verifierContract.VerifyProof(&bind.CallOpts{}, a, b, c, input) 142 | if t.NoError(err, "calling verifier on chain gave error") { 143 | t.False(res, "calling verifier on chain succeed, and shouldn't have") 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /solidity/solidity_plonk_test.go: -------------------------------------------------------------------------------- 1 | package solidity 2 | 3 | import ( 4 | "math/big" 5 | "os" 6 | "testing" 7 | 8 | "github.com/consensys/gnark-crypto/ecc" 9 | "github.com/consensys/gnark/backend/plonk" 10 | plonk_bn254 "github.com/consensys/gnark/backend/plonk/bn254" 11 | "github.com/consensys/gnark/constraint" 12 | "github.com/consensys/gnark/examples/cubic" 13 | "github.com/consensys/gnark/frontend" 14 | "github.com/consensys/gnark/frontend/cs/scs" 15 | "github.com/ethereum/go-ethereum/accounts/abi/bind" 16 | "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" 17 | "github.com/ethereum/go-ethereum/common" 18 | "github.com/ethereum/go-ethereum/core" 19 | "github.com/ethereum/go-ethereum/crypto" 20 | "github.com/stretchr/testify/suite" 21 | ) 22 | 23 | type ExportSolidityTestSuitePlonk struct { 24 | suite.Suite 25 | 26 | // backend 27 | backend *backends.SimulatedBackend 28 | 29 | // verifier contract 30 | verifierContract *PlonkVerifier 31 | 32 | // plonk gnark objects 33 | vk plonk.VerifyingKey 34 | pk plonk.ProvingKey 35 | circuit cubic.Circuit 36 | scs constraint.ConstraintSystem 37 | } 38 | 39 | func TestRunExportSolidityTestSuitePlonk(t *testing.T) { 40 | suite.Run(t, new(ExportSolidityTestSuitePlonk)) 41 | } 42 | 43 | func (t *ExportSolidityTestSuitePlonk) SetupTest() { 44 | 45 | const gasLimit uint64 = 4712388 46 | 47 | // setup simulated backend 48 | key, _ := crypto.GenerateKey() 49 | auth, err := bind.NewKeyedTransactorWithChainID(key, big.NewInt(1337)) 50 | t.NoError(err, "init keyed transactor") 51 | 52 | genesis := map[common.Address]core.GenesisAccount{ 53 | auth.From: {Balance: big.NewInt(1000000000000000000)}, // 1 Eth 54 | } 55 | t.backend = backends.NewSimulatedBackend(genesis, gasLimit) 56 | 57 | // deploy verifier contract 58 | 59 | _, _, v, err := DeployPlonkVerifier(auth, t.backend) 60 | t.NoError(err, "deploy verifier contract failed") 61 | t.verifierContract = v 62 | t.backend.Commit() 63 | 64 | t.scs, err = frontend.Compile(ecc.BN254.ScalarField(), scs.NewBuilder, &t.circuit) 65 | t.NoError(err, "compiling SCS failed") 66 | 67 | // read proving and verifying keys 68 | t.pk = plonk.NewProvingKey(ecc.BN254) 69 | { 70 | f, _ := os.Open("cubic.plonk.pk") 71 | _, err = t.pk.ReadFrom(f) 72 | f.Close() 73 | t.NoError(err, "reading proving key failed") 74 | } 75 | t.vk = plonk.NewVerifyingKey(ecc.BN254) 76 | { 77 | f, _ := os.Open("cubic.plonk.vk") 78 | _, err = t.vk.ReadFrom(f) 79 | f.Close() 80 | t.NoError(err, "reading verifying key failed") 81 | } 82 | 83 | } 84 | 85 | func (t *ExportSolidityTestSuitePlonk) TestVerifyProof() { 86 | 87 | // create a valid proof 88 | var assignment cubic.Circuit 89 | assignment.X = 3 90 | assignment.Y = 35 91 | 92 | // witness creation 93 | witness, err := frontend.NewWitness(&assignment, ecc.BN254.ScalarField()) 94 | t.NoError(err, "witness creation failed") 95 | 96 | // prove 97 | proof, err := plonk.Prove(t.scs, t.pk, witness) 98 | t.NoError(err, "proving failed") 99 | 100 | // ensure gnark (Go) code verifies it 101 | publicWitness, _ := witness.Public() 102 | err = plonk.Verify(proof, t.vk, publicWitness) 103 | t.NoError(err, "verifying failed") 104 | 105 | var publicInputs [1]*big.Int 106 | 107 | p := proof.(*plonk_bn254.Proof) 108 | serializedProof := p.MarshalSolidity() 109 | 110 | // public witness 111 | publicInputs[0] = new(big.Int).SetUint64(35) 112 | // call the contract 113 | res, err := t.verifierContract.Verify(&bind.CallOpts{}, serializedProof[:], publicInputs[:]) 114 | if t.NoError(err, "calling verifier on chain gave error") { 115 | t.True(res, "calling verifier on chain didn't succeed") 116 | } 117 | 118 | // (wrong) public witness 119 | publicInputs[0] = new(big.Int).SetUint64(42) 120 | 121 | // call the contract should fail 122 | res, err = t.verifierContract.Verify(&bind.CallOpts{}, serializedProof[:], publicInputs[:]) 123 | if t.NoError(err, "calling verifier on chain gave error") { 124 | t.False(res, "calling verifier on chain succeed, and shouldn't have") 125 | } 126 | } 127 | --------------------------------------------------------------------------------