mirror of
https://github.com/sonr-io/crypto.git
synced 2026-08-02 15:31:38 +00:00
refactor(crypto): simplify elliptic curve implementation
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user