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:
+7
-7
@@ -42,7 +42,7 @@ The package is built around the concept of secure **Enclaves** that manage distr
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
go get github.com/sonr-io/sonr/crypto/mpc
|
||||
go get github.com/sonr-io/crypto/mpc
|
||||
```
|
||||
|
||||
### Basic Usage
|
||||
@@ -54,7 +54,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/sonr-io/sonr/crypto/mpc"
|
||||
"github.com/sonr-io/crypto/mpc"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -233,7 +233,7 @@ if err != nil {
|
||||
The package includes MPC-based JWT signing for UCAN tokens:
|
||||
|
||||
```go
|
||||
import "github.com/sonr-io/sonr/crypto/mpc/spec"
|
||||
import "github.com/sonr-io/crypto/mpc/spec"
|
||||
|
||||
// Create MPC-backed UCAN token source
|
||||
// (Implementation details in spec package)
|
||||
@@ -448,10 +448,10 @@ go test -cover ./crypto/mpc
|
||||
|
||||
## Dependencies
|
||||
|
||||
- **Core Cryptography**: `github.com/sonr-io/sonr/crypto/core/curves`
|
||||
- **Protocol Framework**: `github.com/sonr-io/sonr/crypto/core/protocol`
|
||||
- **Threshold ECDSA**: `github.com/sonr-io/sonr/crypto/tecdsa/dklsv1`
|
||||
- **UCAN Integration**: `github.com/sonr-io/sonr/crypto/ucan`
|
||||
- **Core Cryptography**: `github.com/sonr-io/crypto/core/curves`
|
||||
- **Protocol Framework**: `github.com/sonr-io/crypto/core/protocol`
|
||||
- **Threshold ECDSA**: `github.com/sonr-io/crypto/tecdsa/dklsv1`
|
||||
- **UCAN Integration**: `github.com/sonr-io/crypto/ucan`
|
||||
- **Standard Crypto**: `golang.org/x/crypto/sha3`
|
||||
- **JWT Support**: `github.com/golang-jwt/jwt`
|
||||
|
||||
|
||||
+3
-3
@@ -4,9 +4,9 @@ package mpc
|
||||
import (
|
||||
"crypto/rand"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/sonr/crypto/core/protocol"
|
||||
"github.com/sonr-io/sonr/crypto/tecdsa/dklsv1/dkg"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/protocol"
|
||||
"github.com/sonr-io/crypto/tecdsa/dklsv1/dkg"
|
||||
)
|
||||
|
||||
type CurveName string
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
"golang.org/x/crypto/sha3"
|
||||
)
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package mpc
|
||||
|
||||
import (
|
||||
"github.com/sonr-io/sonr/crypto/core/protocol"
|
||||
"github.com/sonr-io/sonr/crypto/tecdsa/dklsv1"
|
||||
"github.com/sonr-io/crypto/core/protocol"
|
||||
"github.com/sonr-io/crypto/tecdsa/dklsv1"
|
||||
)
|
||||
|
||||
// NewEnclave generates a new MPC keyshare
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/sonr-io/sonr/crypto/mpc"
|
||||
"github.com/sonr-io/crypto/mpc"
|
||||
)
|
||||
|
||||
// MPCSigningMethod implements the SigningMethod interface for MPC-based signing
|
||||
|
||||
+2
-2
@@ -7,8 +7,8 @@ import (
|
||||
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/libp2p/go-libp2p/core/crypto"
|
||||
"github.com/sonr-io/sonr/crypto/keys"
|
||||
"github.com/sonr-io/sonr/crypto/mpc"
|
||||
"github.com/sonr-io/crypto/keys"
|
||||
"github.com/sonr-io/crypto/mpc"
|
||||
"lukechampine.com/blake3"
|
||||
)
|
||||
|
||||
|
||||
+3
-3
@@ -7,9 +7,9 @@ import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
||||
"github.com/sonr-io/sonr/crypto/core/curves"
|
||||
"github.com/sonr-io/sonr/crypto/core/protocol"
|
||||
"github.com/sonr-io/sonr/crypto/tecdsa/dklsv1"
|
||||
"github.com/sonr-io/crypto/core/curves"
|
||||
"github.com/sonr-io/crypto/core/protocol"
|
||||
"github.com/sonr-io/crypto/tecdsa/dklsv1"
|
||||
"golang.org/x/crypto/sha3"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user