Skip to content

Commit

Permalink
Update module name to v2 (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
yycen authored Aug 26, 2023
1 parent ff989bf commit faf1884
Show file tree
Hide file tree
Showing 96 changed files with 310 additions and 311 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MODULE = github.com/bnb-chain/tss-lib
MODULE = github.com/bnb-chain/tss-lib/v2
PACKAGES = $(shell go list ./... | grep -v '/vendor/')

all: protob test
Expand Down
2 changes: 1 addition & 1 deletion common/hash_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"reflect"
"testing"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/v2/common"
)

func TestRejectionSample(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion common/random_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/v2/common"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions crypto/ckd/child_key_derivation.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"hash"
"math/big"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/crypto"
"github.com/bnb-chain/tss-lib/v2/common"
"github.com/bnb-chain/tss-lib/v2/crypto"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcutil/base58"
"golang.org/x/crypto/ripemd160"
Expand Down
2 changes: 1 addition & 1 deletion crypto/ckd/child_key_derivation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package ckd_test
import (
"testing"

. "github.com/bnb-chain/tss-lib/crypto/ckd"
. "github.com/bnb-chain/tss-lib/v2/crypto/ckd"
"github.com/btcsuite/btcd/btcec"
)

Expand Down
2 changes: 1 addition & 1 deletion crypto/commitments/commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package commitments
import (
"math/big"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/v2/common"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion crypto/commitments/commitment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/stretchr/testify/assert"

. "github.com/bnb-chain/tss-lib/crypto/commitments"
. "github.com/bnb-chain/tss-lib/v2/crypto/commitments"
)

func TestCreateVerify(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions crypto/dlnproof/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"fmt"
"math/big"

"github.com/bnb-chain/tss-lib/common"
cmts "github.com/bnb-chain/tss-lib/crypto/commitments"
"github.com/bnb-chain/tss-lib/v2/common"
cmts "github.com/bnb-chain/tss-lib/v2/crypto/commitments"
)

const Iterations = 128
Expand Down
2 changes: 1 addition & 1 deletion crypto/ecpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

"github.com/decred/dcrd/dcrec/edwards/v2"

"github.com/bnb-chain/tss-lib/tss"
"github.com/bnb-chain/tss-lib/v2/tss"
)

// ECPoint convenience helper
Expand Down
4 changes: 2 additions & 2 deletions crypto/ecpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"github.com/decred/dcrd/dcrec/edwards/v2"
"github.com/stretchr/testify/assert"

. "github.com/bnb-chain/tss-lib/crypto"
"github.com/bnb-chain/tss-lib/tss"
. "github.com/bnb-chain/tss-lib/v2/crypto"
"github.com/bnb-chain/tss-lib/v2/tss"
)

func TestFlattenECPoints(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion crypto/facproof/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"fmt"
"math/big"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/v2/common"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions crypto/facproof/proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (

"github.com/stretchr/testify/assert"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/crypto"
. "github.com/bnb-chain/tss-lib/crypto/facproof"
"github.com/bnb-chain/tss-lib/tss"
"github.com/bnb-chain/tss-lib/v2/common"
"github.com/bnb-chain/tss-lib/v2/crypto"
. "github.com/bnb-chain/tss-lib/v2/crypto/facproof"
"github.com/bnb-chain/tss-lib/v2/tss"
)

// Using a modulus length of 2048 is recommended in the GG18 spec
Expand Down
2 changes: 1 addition & 1 deletion crypto/modproof/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"fmt"
"math/big"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/v2/common"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions crypto/modproof/proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"testing"
"time"

. "github.com/bnb-chain/tss-lib/crypto/modproof"
"github.com/bnb-chain/tss-lib/ecdsa/keygen"
. "github.com/bnb-chain/tss-lib/v2/crypto/modproof"
"github.com/bnb-chain/tss-lib/v2/ecdsa/keygen"
"github.com/stretchr/testify/assert"
)

Expand Down
8 changes: 4 additions & 4 deletions crypto/mta/proofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"fmt"
"math/big"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/crypto"
"github.com/bnb-chain/tss-lib/crypto/paillier"
"github.com/bnb-chain/tss-lib/tss"
"github.com/bnb-chain/tss-lib/v2/common"
"github.com/bnb-chain/tss-lib/v2/crypto"
"github.com/bnb-chain/tss-lib/v2/crypto/paillier"
"github.com/bnb-chain/tss-lib/v2/tss"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions crypto/mta/range_proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"fmt"
"math/big"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/crypto/paillier"
"github.com/bnb-chain/tss-lib/v2/common"
"github.com/bnb-chain/tss-lib/v2/crypto/paillier"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions crypto/mta/range_proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (

"github.com/stretchr/testify/assert"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/crypto"
"github.com/bnb-chain/tss-lib/crypto/paillier"
"github.com/bnb-chain/tss-lib/tss"
"github.com/bnb-chain/tss-lib/v2/common"
"github.com/bnb-chain/tss-lib/v2/crypto"
"github.com/bnb-chain/tss-lib/v2/crypto/paillier"
"github.com/bnb-chain/tss-lib/v2/tss"
)

// Using a modulus length of 2048 is recommended in the GG18 spec
Expand Down
6 changes: 3 additions & 3 deletions crypto/mta/share_protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"errors"
"math/big"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/crypto"
"github.com/bnb-chain/tss-lib/crypto/paillier"
"github.com/bnb-chain/tss-lib/v2/common"
"github.com/bnb-chain/tss-lib/v2/crypto"
"github.com/bnb-chain/tss-lib/v2/crypto/paillier"
)

func AliceInit(
Expand Down
10 changes: 5 additions & 5 deletions crypto/mta/share_protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (

"github.com/stretchr/testify/assert"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/crypto"
"github.com/bnb-chain/tss-lib/crypto/paillier"
"github.com/bnb-chain/tss-lib/ecdsa/keygen"
"github.com/bnb-chain/tss-lib/tss"
"github.com/bnb-chain/tss-lib/v2/common"
"github.com/bnb-chain/tss-lib/v2/crypto"
"github.com/bnb-chain/tss-lib/v2/crypto/paillier"
"github.com/bnb-chain/tss-lib/v2/ecdsa/keygen"
"github.com/bnb-chain/tss-lib/v2/tss"
)

// Using a modulus length of 2048 is recommended in the GG18 spec
Expand Down
4 changes: 2 additions & 2 deletions crypto/paillier/paillier.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (

"github.com/otiai10/primes"

"github.com/bnb-chain/tss-lib/common"
crypto2 "github.com/bnb-chain/tss-lib/crypto"
"github.com/bnb-chain/tss-lib/v2/common"
crypto2 "github.com/bnb-chain/tss-lib/v2/crypto"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions crypto/paillier/paillier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (

"github.com/stretchr/testify/assert"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/crypto"
. "github.com/bnb-chain/tss-lib/crypto/paillier"
"github.com/bnb-chain/tss-lib/tss"
"github.com/bnb-chain/tss-lib/v2/common"
"github.com/bnb-chain/tss-lib/v2/crypto"
. "github.com/bnb-chain/tss-lib/v2/crypto/paillier"
"github.com/bnb-chain/tss-lib/v2/tss"
)

// Using a modulus length of 2048 is recommended in the GG18 spec
Expand Down
4 changes: 2 additions & 2 deletions crypto/schnorr/schnorr_proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"errors"
"math/big"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/crypto"
"github.com/bnb-chain/tss-lib/v2/common"
"github.com/bnb-chain/tss-lib/v2/crypto"
)

type (
Expand Down
8 changes: 4 additions & 4 deletions crypto/schnorr/schnorr_proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (

"github.com/stretchr/testify/assert"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/crypto"
. "github.com/bnb-chain/tss-lib/crypto/schnorr"
"github.com/bnb-chain/tss-lib/tss"
"github.com/bnb-chain/tss-lib/v2/common"
"github.com/bnb-chain/tss-lib/v2/crypto"
. "github.com/bnb-chain/tss-lib/v2/crypto/schnorr"
"github.com/bnb-chain/tss-lib/v2/tss"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion crypto/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"fmt"
"math/big"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/v2/common"
)

func GenerateNTildei(safePrimes [2]*big.Int) (NTildei, h1i, h2i *big.Int, err error) {
Expand Down
7 changes: 3 additions & 4 deletions crypto/vss/feldman_vss.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"fmt"
"math/big"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/crypto"
"github.com/bnb-chain/tss-lib/v2/common"
"github.com/bnb-chain/tss-lib/v2/crypto"
)

type (
Expand Down Expand Up @@ -58,7 +58,6 @@ func CheckIndexes(ec elliptic.Curve, indexes []*big.Int) ([]*big.Int, error) {

// Returns a new array of secret shares created by Shamir's Secret Sharing Algorithm,
// requiring a minimum number of shares to recreate, of length shares, from the input secret
//
func Create(ec elliptic.Curve, threshold int, secret *big.Int, indexes []*big.Int) (Vs, Shares, error) {
if secret == nil || indexes == nil {
return nil, nil, fmt.Errorf("vss secret or indexes == nil: %v %v", secret, indexes)
Expand Down Expand Up @@ -158,8 +157,8 @@ func samplePolynomial(ec elliptic.Curve, threshold int, secret *big.Int) []*big.

// Evauluates a polynomial with coefficients such that:
// evaluatePolynomial([a, b, c, d], x):
// returns a + bx + cx^2 + dx^3
//
// returns a + bx + cx^2 + dx^3
func evaluatePolynomial(ec elliptic.Curve, threshold int, v []*big.Int, id *big.Int) (result *big.Int) {
q := ec.Params().N
modQ := common.ModInt(q)
Expand Down
6 changes: 3 additions & 3 deletions crypto/vss/feldman_vss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

"github.com/stretchr/testify/assert"

"github.com/bnb-chain/tss-lib/common"
. "github.com/bnb-chain/tss-lib/crypto/vss"
"github.com/bnb-chain/tss-lib/tss"
"github.com/bnb-chain/tss-lib/v2/common"
. "github.com/bnb-chain/tss-lib/v2/crypto/vss"
"github.com/bnb-chain/tss-lib/v2/tss"
)

func TestCheckIndexesDup(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion ecdsa/keygen/dln_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"errors"
"math/big"

"github.com/bnb-chain/tss-lib/crypto/dlnproof"
"github.com/bnb-chain/tss-lib/v2/crypto/dlnproof"
)

type DlnProofVerifier struct {
Expand Down
2 changes: 1 addition & 1 deletion ecdsa/keygen/dln_verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"runtime"
"testing"

"github.com/bnb-chain/tss-lib/crypto/dlnproof"
"github.com/bnb-chain/tss-lib/v2/crypto/dlnproof"
)

func BenchmarkDlnProof_Verify(b *testing.B) {
Expand Down
8 changes: 4 additions & 4 deletions ecdsa/keygen/local_party.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"fmt"
"math/big"

"github.com/bnb-chain/tss-lib/common"
cmt "github.com/bnb-chain/tss-lib/crypto/commitments"
"github.com/bnb-chain/tss-lib/crypto/vss"
"github.com/bnb-chain/tss-lib/tss"
"github.com/bnb-chain/tss-lib/v2/common"
cmt "github.com/bnb-chain/tss-lib/v2/crypto/commitments"
"github.com/bnb-chain/tss-lib/v2/crypto/vss"
"github.com/bnb-chain/tss-lib/v2/tss"
)

// Implements Party
Expand Down
14 changes: 7 additions & 7 deletions ecdsa/keygen/local_party_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import (
"github.com/ipfs/go-log"
"github.com/stretchr/testify/assert"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/crypto"
"github.com/bnb-chain/tss-lib/crypto/dlnproof"
"github.com/bnb-chain/tss-lib/crypto/paillier"
"github.com/bnb-chain/tss-lib/crypto/vss"
"github.com/bnb-chain/tss-lib/test"
"github.com/bnb-chain/tss-lib/tss"
"github.com/bnb-chain/tss-lib/v2/common"
"github.com/bnb-chain/tss-lib/v2/crypto"
"github.com/bnb-chain/tss-lib/v2/crypto/dlnproof"
"github.com/bnb-chain/tss-lib/v2/crypto/paillier"
"github.com/bnb-chain/tss-lib/v2/crypto/vss"
"github.com/bnb-chain/tss-lib/v2/test"
"github.com/bnb-chain/tss-lib/v2/tss"
)

const (
Expand Down
16 changes: 8 additions & 8 deletions ecdsa/keygen/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
package keygen

import (
"github.com/bnb-chain/tss-lib/crypto/facproof"
"github.com/bnb-chain/tss-lib/crypto/modproof"
"github.com/bnb-chain/tss-lib/v2/crypto/facproof"
"github.com/bnb-chain/tss-lib/v2/crypto/modproof"
"math/big"

"github.com/bnb-chain/tss-lib/common"
cmt "github.com/bnb-chain/tss-lib/crypto/commitments"
"github.com/bnb-chain/tss-lib/crypto/dlnproof"
"github.com/bnb-chain/tss-lib/crypto/paillier"
"github.com/bnb-chain/tss-lib/crypto/vss"
"github.com/bnb-chain/tss-lib/tss"
"github.com/bnb-chain/tss-lib/v2/common"
cmt "github.com/bnb-chain/tss-lib/v2/crypto/commitments"
"github.com/bnb-chain/tss-lib/v2/crypto/dlnproof"
"github.com/bnb-chain/tss-lib/v2/crypto/paillier"
"github.com/bnb-chain/tss-lib/v2/crypto/vss"
"github.com/bnb-chain/tss-lib/v2/tss"
)

// These messages were generated from Protocol Buffers definitions into ecdsa-keygen.pb.go
Expand Down
Loading

0 comments on commit faf1884

Please sign in to comment.