refactor(crypto): simplify elliptic curve implementation

This commit is contained in:
Prad Nukala
2025-10-09 15:11:59 -04:00
parent a934caa7d3
commit 7d339ae522
205 changed files with 380 additions and 380 deletions
+3 -3
View File
@@ -15,9 +15,9 @@ import (
"github.com/pkg/errors"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/sonr/crypto/internal"
"github.com/sonr-io/sonr/crypto/sharing"
"github.com/sonr-io/crypto/core/curves"
"github.com/sonr-io/crypto/internal"
"github.com/sonr-io/crypto/sharing"
)
// Round1Bcast are values that are broadcast to all other participants
+3 -3
View File
@@ -9,9 +9,9 @@ package frost
import (
"fmt"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/sonr/crypto/internal"
"github.com/sonr-io/sonr/crypto/sharing"
"github.com/sonr-io/crypto/core/curves"
"github.com/sonr-io/crypto/internal"
"github.com/sonr-io/crypto/sharing"
)
// Round2Bcast are values that are broadcast to all other participants
+2 -2
View File
@@ -11,8 +11,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/sonr/crypto/sharing"
"github.com/sonr-io/crypto/core/curves"
"github.com/sonr-io/crypto/sharing"
)
var (
+3 -3
View File
@@ -10,9 +10,9 @@ package frost
import (
"strconv"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/sonr/crypto/internal"
"github.com/sonr-io/sonr/crypto/sharing"
"github.com/sonr-io/crypto/core/curves"
"github.com/sonr-io/crypto/internal"
"github.com/sonr-io/crypto/sharing"
)
type DkgParticipant struct {
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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))
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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.
+4 -4
View File
@@ -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
+2 -2
View File
@@ -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) {
+3 -3
View File
@@ -15,9 +15,9 @@ import (
"github.com/pkg/errors"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/sonr/crypto/dkg/gennaro"
v1 "github.com/sonr-io/sonr/crypto/sharing/v1"
"github.com/sonr-io/crypto/core/curves"
"github.com/sonr-io/crypto/dkg/gennaro"
v1 "github.com/sonr-io/crypto/sharing/v1"
)
const threshold = 2
+2 -2
View File
@@ -15,8 +15,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"
)
var (