Skip to content

Commit

Permalink
Change import names from v3 to v4 (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robingoumaz authored Jun 6, 2024
1 parent 2bf631f commit 0470453
Show file tree
Hide file tree
Showing 132 changed files with 392 additions and 383 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Using the module
----------------

Kyber supports Go modules, and currently has a major version of 3, which means that
the import path is: `go.dedis.ch/kyber/v3`.
the import path is: `go.dedis.ch/kyber/v4`.

Here is a basic example of getting started using it:
1. Make a new directory called “ex". Change directory to “ex" and put this in main.go:
Expand All @@ -57,7 +57,7 @@ package main

import (
"fmt"
"go.dedis.ch/kyber/v3/suites"
"go.dedis.ch/kyber/v4/suites"
)

func main() {
Expand All @@ -67,7 +67,7 @@ func main() {
}
```
2. Type “go mod init example.com/ex”. The resulting go.mod file will have no dependencies listed yet.
3. Type “go build”. The go tool will fill in the new dependencies that it find for you, i.e. "require go.dedis.ch/kyber/v3 v3.0.13”.
3. Type “go build”. The go tool will fill in the new dependencies that it find for you, i.e. "require go.dedis.ch/kyber/v4 v3.0.13”.
4. Running `./ex` will print `0000000000000000000000000000000000000000000000000000000000000000`.

A note on deriving shared secrets
Expand Down
4 changes: 2 additions & 2 deletions encrypt/ecies/ecies.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"errors"
"hash"

"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/util/random"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/util/random"
"golang.org/x/crypto/hkdf"
)

Expand Down
10 changes: 5 additions & 5 deletions encrypt/ecies/ecies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"testing"

"github.com/stretchr/testify/require"
"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/group/curve25519"
"go.dedis.ch/kyber/v3/group/edwards25519"
"go.dedis.ch/kyber/v3/group/nist"
"go.dedis.ch/kyber/v3/util/random"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/group/curve25519"
"go.dedis.ch/kyber/v4/group/edwards25519"
"go.dedis.ch/kyber/v4/group/nist"
"go.dedis.ch/kyber/v4/util/random"
)

func TestECIES(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions encrypt/ibe/ibe.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"errors"
"fmt"
"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/group/mod"
"go.dedis.ch/kyber/v3/pairing"
"go.dedis.ch/kyber/v3/util/random"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/group/mod"
"go.dedis.ch/kyber/v4/pairing"
"go.dedis.ch/kyber/v4/util/random"
)
type Ciphertext struct {
Expand Down
8 changes: 4 additions & 4 deletions encrypt/ibe/ibe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"testing"
"github.com/stretchr/testify/require"
"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/pairing"
bls "go.dedis.ch/kyber/v3/pairing/circl_bls12381"
"go.dedis.ch/kyber/v3/util/random"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/pairing"
bls "go.dedis.ch/kyber/v4/pairing/circl_bls12381"
"go.dedis.ch/kyber/v4/util/random"
)
func newSetting(i uint) (
Expand Down
8 changes: 4 additions & 4 deletions examples/bn256_enc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package examples
import (
"fmt"

"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/pairing"
"go.dedis.ch/kyber/v3/pairing/bn256"
"go.dedis.ch/kyber/v3/util/random"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/pairing"
"go.dedis.ch/kyber/v4/pairing/bn256"
"go.dedis.ch/kyber/v4/util/random"
)

func ElGamalEncryptBn256(suite pairing.Suite, pubkey kyber.Point, message []byte) (
Expand Down
4 changes: 2 additions & 2 deletions examples/dh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package examples
import (
"fmt"

"go.dedis.ch/kyber/v3/group/edwards25519"
"go.dedis.ch/kyber/v3/xof/blake2xb"
"go.dedis.ch/kyber/v4/group/edwards25519"
"go.dedis.ch/kyber/v4/xof/blake2xb"
)

/*
Expand Down
6 changes: 3 additions & 3 deletions examples/enc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package examples
import (
"fmt"

"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/group/edwards25519"
"go.dedis.ch/kyber/v3/util/random"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/group/edwards25519"
"go.dedis.ch/kyber/v4/util/random"
)

func ElGamalEncrypt(group kyber.Group, pubkey kyber.Point, message []byte) (
Expand Down
8 changes: 4 additions & 4 deletions examples/neff_shuffle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"testing"

"github.com/stretchr/testify/require"
"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/group/edwards25519"
kproof "go.dedis.ch/kyber/v3/proof"
"go.dedis.ch/kyber/v3/shuffle"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/group/edwards25519"
kproof "go.dedis.ch/kyber/v4/proof"
"go.dedis.ch/kyber/v4/shuffle"
)

var suite = edwards25519.NewBlakeSHA256Ed25519()
Expand Down
4 changes: 2 additions & 2 deletions examples/sig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"errors"
"fmt"

"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/group/edwards25519"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/group/edwards25519"
)

type Suite interface {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module go.dedis.ch/kyber/v3
module go.dedis.ch/kyber/v4

go 1.20

Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8
go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs=
go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw=
go.dedis.ch/kyber/v3 v3.0.4/go.mod h1:OzvaEnPvKlyrWyp3kGXlFdp7ap1VC6RkZDTaPikqhsQ=
go.dedis.ch/kyber/v3 v3.0.9 h1:i0ZbOQocHUjfFasBiUql5zVeC7u/vahFd96DFA8UOWk=
go.dedis.ch/kyber/v3 v3.0.9/go.mod h1:rhNjUUg6ahf8HEg5HUvVBYoWY4boAafX8tYxX+PS+qg=
go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRLo=
go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI4=
Expand Down
6 changes: 3 additions & 3 deletions group/curve25519/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"io"
"math/big"

"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/group/internal/marshalling"
"go.dedis.ch/kyber/v3/group/mod"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/group/internal/marshalling"
"go.dedis.ch/kyber/v4/group/mod"
)

type basicPoint struct {
Expand Down
2 changes: 1 addition & 1 deletion group/curve25519/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package curve25519
import (
"testing"

"go.dedis.ch/kyber/v3/util/test"
"go.dedis.ch/kyber/v4/util/test"
)

// Test the basic implementation of the Ed25519 curve.
Expand Down
6 changes: 3 additions & 3 deletions group/curve25519/curve.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"fmt"
"math/big"

"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/group/mod"
"go.dedis.ch/kyber/v3/util/random"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/group/mod"
"go.dedis.ch/kyber/v4/util/random"
)

var zero = big.NewInt(0)
Expand Down
4 changes: 2 additions & 2 deletions group/curve25519/curve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package curve25519
import (
"testing"

"go.dedis.ch/kyber/v3/group/edwards25519"
"go.dedis.ch/kyber/v3/util/test"
"go.dedis.ch/kyber/v4/group/edwards25519"
"go.dedis.ch/kyber/v4/util/test"
)

var testSuite = NewBlakeSHA256Curve25519(false)
Expand Down
6 changes: 3 additions & 3 deletions group/curve25519/ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"io"
"math/big"

"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/group/internal/marshalling"
"go.dedis.ch/kyber/v3/group/mod"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/group/internal/marshalling"
"go.dedis.ch/kyber/v4/group/mod"
)

type extPoint struct {
Expand Down
2 changes: 1 addition & 1 deletion group/curve25519/param.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package curve25519
import (
"math/big"

"go.dedis.ch/kyber/v3/group/mod"
"go.dedis.ch/kyber/v4/group/mod"
)

// Param defines a Twisted Edwards curve (TEC).
Expand Down
6 changes: 3 additions & 3 deletions group/curve25519/proj.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"io"
"math/big"

"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/group/internal/marshalling"
"go.dedis.ch/kyber/v3/group/mod"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/group/internal/marshalling"
"go.dedis.ch/kyber/v4/group/mod"
)

type projPoint struct {
Expand Down
10 changes: 5 additions & 5 deletions group/curve25519/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"reflect"

"go.dedis.ch/fixbuf"
"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/group/internal/marshalling"
"go.dedis.ch/kyber/v3/util/random"
"go.dedis.ch/kyber/v3/xof/blake2xb"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/group/internal/marshalling"
"go.dedis.ch/kyber/v4/util/random"
"go.dedis.ch/kyber/v4/xof/blake2xb"
)

// SuiteCurve25519 is the suite for the 25519 curve
Expand Down Expand Up @@ -49,7 +49,7 @@ func (s *SuiteCurve25519) RandomStream() cipher.Stream {
}

// NewBlakeSHA256Curve25519 returns a cipher suite based on package
// go.dedis.ch/kyber/v3/xof/blake2xb, SHA-256, and Curve25519.
// go.dedis.ch/kyber/v4/xof/blake2xb, SHA-256, and Curve25519.
//
// If fullGroup is false, then the group is the prime-order subgroup.
//
Expand Down
2 changes: 1 addition & 1 deletion group/edwards25519/allowvt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package edwards25519
import (
"testing"

"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v4"
)

func TestVartime(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions group/edwards25519/curve.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"crypto/cipher"
"crypto/sha512"

"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/util/random"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/util/random"
)

// Curve represents the Ed25519 group.
Expand Down
2 changes: 1 addition & 1 deletion group/edwards25519/curve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"go.dedis.ch/kyber/v3/util/test"
"go.dedis.ch/kyber/v4/util/test"
)

var tSuite = NewBlakeSHA256Ed25519()
Expand Down
4 changes: 2 additions & 2 deletions group/edwards25519/point.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"errors"
"io"

"go.dedis.ch/kyber/v3"
"go.dedis.ch/kyber/v3/group/internal/marshalling"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/group/internal/marshalling"
)

var marshalPointID = [8]byte{'e', 'd', '.', 'p', 'o', 'i', 'n', 't'}
Expand Down
Loading

0 comments on commit 0470453

Please sign in to comment.