mirror of
https://github.com/sonr-io/crypto.git
synced 2026-01-12 04:09:13 +00:00
refactor(crypto): simplify elliptic curve implementation
This commit is contained in:
@@ -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"
|
||||
)
|
||||
|
||||
var testCurve = curves.ED25519()
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
type FeldmanVerifier struct {
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
// Pedersen Verifiable Secret Sharing Scheme
|
||||
|
||||
@@ -9,7 +9,7 @@ package sharing
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
type Polynomial struct {
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
func TestNewPoly(t *testing.T) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
type ShamirShare struct {
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
func TestShamirSplitInvalidArgs(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"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
"math/big"
|
||||
"sync"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves/native"
|
||||
"github.com/sonr-io/sonr/crypto/core/curves/native/bls12381"
|
||||
"github.com/sonr-io/sonr/crypto/internal"
|
||||
"github.com/sonr-io/crypto/core/curves/native"
|
||||
"github.com/sonr-io/crypto/core/curves/native/bls12381"
|
||||
"github.com/sonr-io/crypto/internal"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"math/big"
|
||||
"sync"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves/native"
|
||||
"github.com/sonr-io/sonr/crypto/core/curves/native/bls12381"
|
||||
"github.com/sonr-io/crypto/core/curves/native"
|
||||
"github.com/sonr-io/crypto/core/curves/native/bls12381"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
kryptology "github.com/sonr-io/sonr/crypto/core/curves"
|
||||
kryptology "github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
// ShareVerifier is used to verify secret shares from Feldman or Pedersen VSS
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
"filippo.io/edwards25519"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
core "github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/sonr/crypto/internal"
|
||||
core "github.com/sonr-io/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/internal"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
|
||||
ed "filippo.io/edwards25519"
|
||||
|
||||
"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 (
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
// Feldman Verifiable Secret Sharing Scheme
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
core "github.com/sonr-io/sonr/crypto/core/curves"
|
||||
core "github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
||||
"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"
|
||||
)
|
||||
|
||||
// Pedersen Verifiable Secret Sharing Scheme
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
type polynomial struct {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
// ShamirShare is the data from splitting a secret
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
)
|
||||
|
||||
func TestShamirSplitInvalidArgs(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user