refactor(crypto): migrate to new go module path code.sonr.org/go/did-it/crypto
This commit is contained in:
@@ -3,15 +3,15 @@ package allkeys
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||||
helpers "github.com/MetaMask/go-did-it/crypto/internal"
|
helpers "code.sonr.org/go/did-it/crypto/internal"
|
||||||
"github.com/MetaMask/go-did-it/crypto/p256"
|
"code.sonr.org/go/did-it/crypto/p256"
|
||||||
"github.com/MetaMask/go-did-it/crypto/p384"
|
"code.sonr.org/go/did-it/crypto/p384"
|
||||||
"github.com/MetaMask/go-did-it/crypto/p521"
|
"code.sonr.org/go/did-it/crypto/p521"
|
||||||
"github.com/MetaMask/go-did-it/crypto/rsa"
|
"code.sonr.org/go/did-it/crypto/rsa"
|
||||||
"github.com/MetaMask/go-did-it/crypto/secp256k1"
|
"code.sonr.org/go/did-it/crypto/secp256k1"
|
||||||
"github.com/MetaMask/go-did-it/crypto/x25519"
|
"code.sonr.org/go/did-it/crypto/x25519"
|
||||||
)
|
)
|
||||||
|
|
||||||
var decoders = map[uint64]func(b []byte) (crypto.PublicKey, error){
|
var decoders = map[uint64]func(b []byte) (crypto.PublicKey, error){
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestHarness describes a keypair implementation for the test/bench suites to operate on.
|
// TestHarness describes a keypair implementation for the test/bench suites to operate on.
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package ed25519
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/_testsuite"
|
"code.sonr.org/go/did-it/crypto/_testsuite"
|
||||||
)
|
)
|
||||||
|
|
||||||
var harness = testsuite.TestHarness[PublicKey, PrivateKey]{
|
var harness = testsuite.TestHarness[PublicKey, PrivateKey]{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
"golang.org/x/crypto/cryptobyte"
|
"golang.org/x/crypto/cryptobyte"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PrivateKeySigningBytes = &PrivateKey{}
|
var _ crypto.PrivateKeySigningBytes = &PrivateKey{}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
"golang.org/x/crypto/cryptobyte"
|
"golang.org/x/crypto/cryptobyte"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/internal"
|
"code.sonr.org/go/did-it/crypto/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PublicKeySigningBytes = PublicKey{}
|
var _ crypto.PublicKeySigningBytes = PublicKey{}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
|
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/p256"
|
"code.sonr.org/go/did-it/crypto/p256"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Example() {
|
func Example() {
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||||
"github.com/MetaMask/go-did-it/crypto/p256"
|
"code.sonr.org/go/did-it/crypto/p256"
|
||||||
"github.com/MetaMask/go-did-it/crypto/p384"
|
"code.sonr.org/go/did-it/crypto/p384"
|
||||||
"github.com/MetaMask/go-did-it/crypto/p521"
|
"code.sonr.org/go/did-it/crypto/p521"
|
||||||
"github.com/MetaMask/go-did-it/crypto/rsa"
|
"code.sonr.org/go/did-it/crypto/rsa"
|
||||||
"github.com/MetaMask/go-did-it/crypto/secp256k1"
|
"code.sonr.org/go/did-it/crypto/secp256k1"
|
||||||
"github.com/MetaMask/go-did-it/crypto/x25519"
|
"code.sonr.org/go/did-it/crypto/x25519"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PrivateJwk is a JWK holding a private key
|
// PrivateJwk is a JWK holding a private key
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||||
"github.com/MetaMask/go-did-it/crypto/p256"
|
"code.sonr.org/go/did-it/crypto/p256"
|
||||||
"github.com/MetaMask/go-did-it/crypto/p384"
|
"code.sonr.org/go/did-it/crypto/p384"
|
||||||
"github.com/MetaMask/go-did-it/crypto/p521"
|
"code.sonr.org/go/did-it/crypto/p521"
|
||||||
"github.com/MetaMask/go-did-it/crypto/rsa"
|
"code.sonr.org/go/did-it/crypto/rsa"
|
||||||
"github.com/MetaMask/go-did-it/crypto/secp256k1"
|
"code.sonr.org/go/did-it/crypto/secp256k1"
|
||||||
"github.com/MetaMask/go-did-it/crypto/x25519"
|
"code.sonr.org/go/did-it/crypto/x25519"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Specification:
|
// Specification:
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/_testsuite"
|
"code.sonr.org/go/did-it/crypto/_testsuite"
|
||||||
)
|
)
|
||||||
|
|
||||||
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{
|
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PrivateKeySigningBytes = &PrivateKey{}
|
var _ crypto.PrivateKeySigningBytes = &PrivateKey{}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
|
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
helpers "github.com/MetaMask/go-did-it/crypto/internal"
|
helpers "code.sonr.org/go/did-it/crypto/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PublicKeySigningBytes = &PublicKey{}
|
var _ crypto.PublicKeySigningBytes = &PublicKey{}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package p384
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/_testsuite"
|
"code.sonr.org/go/did-it/crypto/_testsuite"
|
||||||
)
|
)
|
||||||
|
|
||||||
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{
|
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PrivateKeySigningBytes = &PrivateKey{}
|
var _ crypto.PrivateKeySigningBytes = &PrivateKey{}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
|
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
helpers "github.com/MetaMask/go-did-it/crypto/internal"
|
helpers "code.sonr.org/go/did-it/crypto/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PublicKeySigningBytes = &PublicKey{}
|
var _ crypto.PublicKeySigningBytes = &PublicKey{}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package p521
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/_testsuite"
|
"code.sonr.org/go/did-it/crypto/_testsuite"
|
||||||
)
|
)
|
||||||
|
|
||||||
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{
|
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PrivateKeySigningBytes = &PrivateKey{}
|
var _ crypto.PrivateKeySigningBytes = &PrivateKey{}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
|
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
helpers "github.com/MetaMask/go-did-it/crypto/internal"
|
helpers "code.sonr.org/go/did-it/crypto/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PublicKeySigningBytes = &PublicKey{}
|
var _ crypto.PublicKeySigningBytes = &PublicKey{}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"crypto/rsa"
|
"crypto/rsa"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/_testsuite"
|
"code.sonr.org/go/did-it/crypto/_testsuite"
|
||||||
)
|
)
|
||||||
|
|
||||||
var harness2048 = testsuite.TestHarness[*PublicKey, *PrivateKey]{
|
var harness2048 = testsuite.TestHarness[*PublicKey, *PrivateKey]{
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PrivateKeySigningASN1 = &PrivateKey{}
|
var _ crypto.PrivateKeySigningASN1 = &PrivateKey{}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
|
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
helpers "github.com/MetaMask/go-did-it/crypto/internal"
|
helpers "code.sonr.org/go/did-it/crypto/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PublicKeySigningASN1 = &PublicKey{}
|
var _ crypto.PublicKeySigningASN1 = &PublicKey{}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/_testsuite"
|
"code.sonr.org/go/did-it/crypto/_testsuite"
|
||||||
)
|
)
|
||||||
|
|
||||||
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{
|
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
|
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PrivateKeySigningBytes = &PrivateKey{}
|
var _ crypto.PrivateKeySigningBytes = &PrivateKey{}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
|
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
helpers "github.com/MetaMask/go-did-it/crypto/internal"
|
helpers "code.sonr.org/go/did-it/crypto/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PublicKeySigningBytes = &PublicKey{}
|
var _ crypto.PublicKeySigningBytes = &PublicKey{}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto/_testsuite"
|
"code.sonr.org/go/did-it/crypto/_testsuite"
|
||||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||||
)
|
)
|
||||||
|
|
||||||
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{
|
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PrivateKeyKeyExchange = (*PrivateKey)(nil)
|
var _ crypto.PrivateKeyKeyExchange = (*PrivateKey)(nil)
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||||
helpers "github.com/MetaMask/go-did-it/crypto/internal"
|
helpers "code.sonr.org/go/did-it/crypto/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ crypto.PublicKey = (*PublicKey)(nil)
|
var _ crypto.PublicKey = (*PublicKey)(nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user