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
+1 -1
View File
@@ -9,7 +9,7 @@ package frost
import (
"crypto/sha512"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/crypto/core/curves"
)
type ChallengeDerive interface {
+3 -3
View File
@@ -10,9 +10,9 @@ package frost
import (
"fmt"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/sonr/crypto/dkg/frost"
"github.com/sonr-io/sonr/crypto/internal"
"github.com/sonr-io/crypto/core/curves"
"github.com/sonr-io/crypto/dkg/frost"
"github.com/sonr-io/crypto/internal"
)
// Signer is a tSchnorr player performing the signing operation.
+2 -2
View File
@@ -13,8 +13,8 @@ import (
"github.com/pkg/errors"
"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"
)
// Round1Bcast contains values to be broadcast to all players after the completion of signing round 1.
+2 -2
View File
@@ -13,8 +13,8 @@ import (
"github.com/pkg/errors"
"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"
)
// Round2Bcast contains values that will be broadcast to other signers after completion of round 2.
+2 -2
View File
@@ -9,8 +9,8 @@ package frost
import (
"fmt"
"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"
)
// Round3Bcast contains the output of FROST signature, i.e., it contains FROST signature (z,c) and the
+3 -3
View File
@@ -11,9 +11,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/sonr-io/sonr/crypto/core/curves"
dkg "github.com/sonr-io/sonr/crypto/dkg/frost"
"github.com/sonr-io/sonr/crypto/sharing"
"github.com/sonr-io/crypto/core/curves"
dkg "github.com/sonr-io/crypto/dkg/frost"
"github.com/sonr-io/crypto/sharing"
)
var (
+1 -1
View File
@@ -21,7 +21,7 @@ import (
"fmt"
"io"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/crypto/core/curves"
)
const (
+1 -1
View File
@@ -16,7 +16,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/crypto/core/curves"
)
// sign.input.gz is a selection of test cases from
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"crypto/sha512"
"strconv"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/crypto/core/curves"
)
// GeAdd returns the sum of two public keys, a and b.
+2 -2
View File
@@ -14,8 +14,8 @@ import (
"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"
)
const (
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"encoding/binary"
"fmt"
"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"
)
// PublicKeyFromBytes converts byte array into PublicKey byte array
+2 -2
View File
@@ -12,8 +12,8 @@ import (
"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 TestGenerateEd25519Key(t *testing.T) {
+1 -1
View File
@@ -13,7 +13,7 @@ import (
"golang.org/x/crypto/hkdf"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/crypto/core/curves"
)
// NonceShare represents a share of a generated nonce.
+2 -2
View File
@@ -12,8 +12,8 @@ import (
"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 TestNonceShareFromBytes(t *testing.T) {
+1 -1
View File
@@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/crypto/core/curves"
)
func TestPartialSignNormalSignature(t *testing.T) {
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"bytes"
"fmt"
"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"
)
type Signature = []byte
+1 -1
View File
@@ -15,7 +15,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/sonr-io/sonr/crypto/core/curves"
"github.com/sonr-io/crypto/core/curves"
)
func AggregateSignatures(sig1, sig2 *PartialSignature) []byte {