mirror of
https://github.com/sonr-io/crypto.git
synced 2026-08-02 23:41:37 +00:00
refactor(crypto): simplify elliptic curve implementation
This commit is contained in:
@@ -11,9 +11,9 @@ import (
|
||||
"crypto/elliptic"
|
||||
"fmt"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/sonr/crypto/internal"
|
||||
v1 "github.com/sonr-io/sonr/crypto/sharing/v1"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/internal"
|
||||
v1 "github.com/sonr-io/crypto/sharing/v1"
|
||||
)
|
||||
|
||||
// Participant is a DKG player that contains information needed to perform DKG rounds
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/sonr/crypto/internal"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/internal"
|
||||
)
|
||||
|
||||
var testGenerator, _ = curves.NewScalarBaseMult(btcec.S256(), big.NewInt(3333))
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core"
|
||||
"github.com/sonr-io/sonr/crypto/internal"
|
||||
v1 "github.com/sonr-io/sonr/crypto/sharing/v1"
|
||||
"github.com/sonr-io/crypto/core"
|
||||
"github.com/sonr-io/crypto/internal"
|
||||
v1 "github.com/sonr-io/crypto/sharing/v1"
|
||||
)
|
||||
|
||||
// Round1Bcast are the values that are broadcast to all other participants
|
||||
|
||||
@@ -9,8 +9,8 @@ package gennaro
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/internal"
|
||||
v1 "github.com/sonr-io/sonr/crypto/sharing/v1"
|
||||
"github.com/sonr-io/crypto/internal"
|
||||
v1 "github.com/sonr-io/crypto/sharing/v1"
|
||||
)
|
||||
|
||||
type Round2Bcast = []*v1.ShareVerifier
|
||||
|
||||
@@ -9,8 +9,8 @@ package gennaro
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/internal"
|
||||
v1 "github.com/sonr-io/sonr/crypto/sharing/v1"
|
||||
"github.com/sonr-io/crypto/internal"
|
||||
v1 "github.com/sonr-io/crypto/sharing/v1"
|
||||
)
|
||||
|
||||
// Round3Bcast contains values that will be broadcast to other participants.
|
||||
|
||||
@@ -9,10 +9,10 @@ package gennaro
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core"
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/sonr/crypto/internal"
|
||||
v1 "github.com/sonr-io/sonr/crypto/sharing/v1"
|
||||
"github.com/sonr-io/crypto/core"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/internal"
|
||||
v1 "github.com/sonr-io/crypto/sharing/v1"
|
||||
)
|
||||
|
||||
// Round4 computes the public shares used by tECDSA during signing
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
v1 "github.com/sonr-io/sonr/crypto/sharing/v1"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
v1 "github.com/sonr-io/crypto/sharing/v1"
|
||||
)
|
||||
|
||||
func TestParticipantRound1Works(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user