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
+5 -5
View File
@@ -15,11 +15,11 @@ import (
"golang.org/x/crypto/hkdf"
"github.com/sonr-io/sonr/crypto/core/curves"
"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/sonr/crypto/sharing"
"github.com/sonr-io/crypto/core/curves"
"github.com/sonr-io/crypto/core/curves/native"
"github.com/sonr-io/crypto/core/curves/native/bls12381"
"github.com/sonr-io/crypto/internal"
"github.com/sonr-io/crypto/sharing"
)
// Secret key in Fr
+2 -2
View File
@@ -13,8 +13,8 @@ import (
"math/big"
"testing"
"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/bls12381"
"github.com/sonr-io/crypto/internal"
)
func genSecretKey(t *testing.T) *SecretKey {
+3 -3
View File
@@ -9,9 +9,9 @@ package bls_sig
import (
"fmt"
"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"
)
// Implement BLS signatures on the BLS12-381 curve
@@ -9,7 +9,7 @@ package bls_sig
import (
"testing"
"github.com/sonr-io/sonr/crypto/core/curves/native/bls12381"
"github.com/sonr-io/crypto/core/curves/native/bls12381"
)
func generateAugSignatureG1(sk *SecretKey, msg []byte, t *testing.T) *SignatureVt {
@@ -9,7 +9,7 @@ package bls_sig
import (
"testing"
"github.com/sonr-io/sonr/crypto/core/curves/native/bls12381"
"github.com/sonr-io/crypto/core/curves/native/bls12381"
)
func generateBasicSignatureG1(sk *SecretKey, msg []byte, t *testing.T) *SignatureVt {
@@ -12,7 +12,7 @@ import (
"math/rand"
"testing"
"github.com/sonr-io/sonr/crypto/core/curves/native/bls12381"
"github.com/sonr-io/crypto/core/curves/native/bls12381"
)
const numAggregateG1 = 10
+3 -3
View File
@@ -9,9 +9,9 @@ package bls_sig
import (
"fmt"
"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"
)
// Implement BLS signatures on the BLS12-381 curve
@@ -9,7 +9,7 @@ package bls_sig
import (
"testing"
"github.com/sonr-io/sonr/crypto/core/curves/native/bls12381"
"github.com/sonr-io/crypto/core/curves/native/bls12381"
)
func generateAugSignatureG2(sk *SecretKey, msg []byte, t *testing.T) *Signature {
@@ -9,7 +9,7 @@ package bls_sig
import (
"testing"
"github.com/sonr-io/sonr/crypto/core/curves/native/bls12381"
"github.com/sonr-io/crypto/core/curves/native/bls12381"
)
func generateBasicSignatureG2(sk *SecretKey, msg []byte, t *testing.T) *Signature {
@@ -12,7 +12,7 @@ import (
"math/rand"
"testing"
"github.com/sonr-io/sonr/crypto/core/curves/native/bls12381"
"github.com/sonr-io/crypto/core/curves/native/bls12381"
)
const numAggregateG2 = 10
+1 -1
View File
@@ -14,7 +14,7 @@ import (
"fmt"
"os"
bls "github.com/sonr-io/sonr/crypto/signatures/bls/bls_sig"
bls "github.com/sonr-io/crypto/signatures/bls/bls_sig"
)
type signOp struct {