Skip to content

Commit

Permalink
update imports in golang bindings (#498)
Browse files Browse the repository at this point in the history
## Describe the changes

This PR updates imports in golang bindings to the v2 version
  • Loading branch information
nonam3e authored Apr 24, 2024
1 parent 14b39b5 commit f8d15e2
Show file tree
Hide file tree
Showing 152 changed files with 510 additions and 471 deletions.
4 changes: 2 additions & 2 deletions docs/docs/icicle/golang-bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ import (
"github.com/stretchr/testify/assert"
"testing"

"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)
...
```
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/icicle/golang-bindings/ecntt.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ func GetDefaultNTTConfig[T any](cosetGen T) NTTConfig[T]
package main

import (
"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)

func Main() {
Expand Down
12 changes: 6 additions & 6 deletions docs/docs/icicle/golang-bindings/msm-pre-computation.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ package main
import (
"log"

"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bn254"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bn254"
)

func main() {
Expand Down Expand Up @@ -85,9 +85,9 @@ package main
import (
"log"

"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
g2 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bn254/g2"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
g2 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bn254/g2"
)

func main() {
Expand Down
14 changes: 7 additions & 7 deletions docs/docs/icicle/golang-bindings/msm.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
package main

import (
"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bn254"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bn254"
)

func main() {
Expand Down Expand Up @@ -167,7 +167,7 @@ Now you may import `g2` package of the specified curve.

```go
import (
"github.com/ingonyama-zk/icicle/wrappers/golang/curves/bls254/g2"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bls254/g2"
)
```

Expand All @@ -177,9 +177,9 @@ This package include `G2Projective` and `G2Affine` points as well as a `G2Msm` m
package main

import (
"github.com/ingonyama-zk/icicle/wrappers/golang/core"
bn254 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bn254"
g2 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bn254/g2"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
bn254 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bn254"
g2 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bn254/g2"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/icicle/golang-bindings/multi-gpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"fmt"
"sync"

"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bn254"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bn254"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/icicle/golang-bindings/ntt.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
package main

import (
"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bn254"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bn254"

"github.com/consensys/gnark-crypto/ecc/bn254/fr/fft"
)
Expand Down
18 changes: 9 additions & 9 deletions docs/docs/icicle/golang-bindings/vec-ops.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Icicle is exposing a number of vector operations which a user can control:
package main

import (
"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bn254"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bn254"
)

func main() {
Expand All @@ -41,9 +41,9 @@ func main() {
package main

import (
"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bn254"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bn254"
)

func main() {
Expand All @@ -67,9 +67,9 @@ func main() {
package main

import (
"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bn254"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
bn254 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bn254"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion wrappers/golang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ This is normally fixed by exporting the path to the shared library location in t
### cuda_runtime.h: No such file or directory

```
# github.com/ingonyama-zk/icicle/wrappers/golang/curves/bls12381
# github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bls12381
In file included from wrappers/golang/curves/bls12381/curve.go:5:
wrappers/golang/curves/bls12381/include/curve.h:1:10: fatal error: cuda_runtime.h: No such file or directory
1 | #include <cuda_runtime.h>
Expand Down
2 changes: 1 addition & 1 deletion wrappers/golang/core/error.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package core

import (
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)

type IcicleErrorCode int
Expand Down
2 changes: 1 addition & 1 deletion wrappers/golang/core/msm.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"unsafe"

cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)

type MSMConfig struct {
Expand Down
4 changes: 2 additions & 2 deletions wrappers/golang/core/msm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package core
import (
"testing"

"github.com/ingonyama-zk/icicle/wrappers/golang/core/internal"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core/internal"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion wrappers/golang/core/ntt.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"unsafe"

cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)

type NTTDir int8
Expand Down
4 changes: 2 additions & 2 deletions wrappers/golang/core/ntt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package core
import (
"testing"

"github.com/ingonyama-zk/icicle/wrappers/golang/core/internal"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core/internal"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion wrappers/golang/core/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package core
import (
"unsafe"

cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)

type HostOrDeviceSlice interface {
Expand Down
2 changes: 1 addition & 1 deletion wrappers/golang/core/slice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"unsafe"

"github.com/ingonyama-zk/icicle/wrappers/golang/core/internal"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core/internal"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion wrappers/golang/core/vec_ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"unsafe"

cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)

type VecOps int
Expand Down
2 changes: 1 addition & 1 deletion wrappers/golang/core/vec_ops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package core
import (
"testing"

cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions wrappers/golang/curves/bls12377/curve.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import "C"
import (
"unsafe"

"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)

type Projective struct {
Expand Down
4 changes: 2 additions & 2 deletions wrappers/golang/curves/bls12377/ecntt/ecntt.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ package ecntt
import "C"

import (
"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)

func ECNtt[T any](points core.HostOrDeviceSlice, dir core.NTTDir, cfg *core.NTTConfig[T], results core.HostOrDeviceSlice) core.IcicleError {
Expand Down
4 changes: 2 additions & 2 deletions wrappers/golang/curves/bls12377/g2/curve.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import "C"
import (
"unsafe"

"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)

type G2Projective struct {
Expand Down
5 changes: 3 additions & 2 deletions wrappers/golang/curves/bls12377/g2/msm.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ package g2
import "C"

import (
"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
"unsafe"

"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)

func G2GetDefaultMSMConfig() core.MSMConfig {
Expand Down
5 changes: 3 additions & 2 deletions wrappers/golang/curves/bls12377/msm/msm.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ package msm
import "C"

import (
"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
"unsafe"

"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)

func GetDefaultMSMConfig() core.MSMConfig {
Expand Down
10 changes: 4 additions & 6 deletions wrappers/golang/curves/bls12377/ntt/ntt.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ package ntt
// #include "ntt.h"
import "C"

import (
"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
bls12_377 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bls12377"
)

import (
"unsafe"

"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
bls12_377 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bls12377"
)

func Ntt[T any](scalars core.HostOrDeviceSlice, dir core.NTTDir, cfg *core.NTTConfig[T], results core.HostOrDeviceSlice) core.IcicleError {
Expand Down
4 changes: 2 additions & 2 deletions wrappers/golang/curves/bls12377/polynomial/polynomial.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import "C"
import (
"unsafe"

"github.com/ingonyama-zk/icicle/wrappers/golang/core"
bls12_377 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bls12377"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
bls12_377 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bls12377"
)

type PolynomialHandle = C.struct_PolynomialInst
Expand Down
5 changes: 3 additions & 2 deletions wrappers/golang/curves/bls12377/scalar_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import "C"
import (
"encoding/binary"
"fmt"
"github.com/ingonyama-zk/icicle/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/wrappers/golang/cuda_runtime"
"unsafe"

"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
cr "github.com/ingonyama-zk/icicle/v2/wrappers/golang/cuda_runtime"
)

const (
Expand Down
7 changes: 4 additions & 3 deletions wrappers/golang/curves/bls12377/tests/base_field_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package tests

import (
bls12_377 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bls12377"
"github.com/ingonyama-zk/icicle/wrappers/golang/test_helpers"
"github.com/stretchr/testify/assert"
"testing"

bls12_377 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bls12377"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/test_helpers"
"github.com/stretchr/testify/assert"
)

const (
Expand Down
7 changes: 4 additions & 3 deletions wrappers/golang/curves/bls12377/tests/curve_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package tests

import (
bls12_377 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bls12377"
"github.com/ingonyama-zk/icicle/wrappers/golang/test_helpers"
"github.com/stretchr/testify/assert"
"testing"

bls12_377 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bls12377"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/test_helpers"
"github.com/stretchr/testify/assert"
)

func TestAffineZero(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions wrappers/golang/curves/bls12377/tests/ecntt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package tests
import (
"testing"

"github.com/ingonyama-zk/icicle/wrappers/golang/core"
bls12_377 "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bls12377"
ecntt "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bls12377/ecntt"
ntt "github.com/ingonyama-zk/icicle/wrappers/golang/curves/bls12377/ntt"
"github.com/ingonyama-zk/icicle/v2/wrappers/golang/core"
bls12_377 "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bls12377"
ecntt "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bls12377/ecntt"
ntt "github.com/ingonyama-zk/icicle/v2/wrappers/golang/curves/bls12377/ntt"
"github.com/stretchr/testify/assert"
)

Expand Down
Loading

0 comments on commit f8d15e2

Please sign in to comment.