Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump golang.org/x/crypto from 0.0.0-20210921155107-089bfa567519 to 0.17.0 #34

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ go 1.12

require (
github.com/stretchr/testify v1.4.0
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
golang.org/x/text v0.3.8
golang.org/x/crypto v0.23.0
golang.org/x/text v0.15.0
)
28 changes: 25 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,51 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
6 changes: 4 additions & 2 deletions wallet/account_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package wallet

import (
"github.com/joeqian10/neo-gogogo/wallet/keys"
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"

"github.com/joeqian10/neo-gogogo/wallet/keys"
)

func TestNewAccount(t *testing.T) {
Expand Down
23 changes: 15 additions & 8 deletions wallet/keys/keyPair.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ import (
"crypto/rand"
"crypto/sha256"
"fmt"
"math/big"

"github.com/joeqian10/neo-gogogo/crypto"
"github.com/joeqian10/neo-gogogo/helper"
"math/big"
)

type KeyPairSlice []*KeyPair

func (kps KeyPairSlice) Len() int { return len(kps)}
func (kps KeyPairSlice) Less(i, j int) bool { return kps[i].PublicKey.Compare(kps[j].PublicKey) == -1}
func (kps KeyPairSlice) Swap(i, j int) { kps[i], kps[j] = kps[j], kps[i]}
func (kps KeyPairSlice) Len() int { return len(kps) }
func (kps KeyPairSlice) Less(i, j int) bool { return kps[i].PublicKey.Compare(kps[j].PublicKey) == -1 }
func (kps KeyPairSlice) Swap(i, j int) { kps[i], kps[j] = kps[j], kps[i] }

type KeyPair struct {
PrivateKey []byte
Expand Down Expand Up @@ -140,12 +141,18 @@ func VerifySignature(message []byte, signature []byte, p *PublicKey) bool {
func VerifyMultiSig(message []byte, signatures [][]byte, pubKeys []*PublicKey) bool {
m := len(signatures)
n := len(pubKeys)
if m==0 || n==0 || m>n {return false}
if m == 0 || n == 0 || m > n {
return false
}
var success bool = true
for i, j := 0, 0; success && i < m && j < n; {
if VerifySignature(message, signatures[i], pubKeys[j]) {i++}
if VerifySignature(message, signatures[i], pubKeys[j]) {
i++
}
j++
if m-i > n-j {success=false}
if m-i > n-j {
success = false
}
}
return success
}
}
3 changes: 2 additions & 1 deletion wallet/keys/keyPair_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package keys

import (
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestExportWIF(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion wallet/keys/nep2.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
"bytes"
"errors"
"fmt"
. "github.com/joeqian10/neo-gogogo/crypto"

"golang.org/x/crypto/scrypt"
"golang.org/x/text/unicode/norm"

Check failure on line 9 in wallet/keys/nep2.go

View workflow job for this annotation

GitHub Actions / Build

found packages norm (composition.go) and main (maketables.go) in /home/runner/go/pkg/mod/golang.org/x/[email protected]/unicode/norm

. "github.com/joeqian10/neo-gogogo/crypto"
)

// NEP-2 standard implementation for encrypting and decrypting private keys.
Expand Down
7 changes: 4 additions & 3 deletions wallet/keys/publicKey.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import (
"encoding/binary"
"encoding/hex"
"fmt"
"github.com/joeqian10/neo-gogogo/crypto"
"github.com/joeqian10/neo-gogogo/helper"
"github.com/joeqian10/neo-gogogo/sc"
"io"
"math/big"
"sort"

"github.com/joeqian10/neo-gogogo/crypto"
"github.com/joeqian10/neo-gogogo/helper"
"github.com/joeqian10/neo-gogogo/sc"
)

// PublicKeys is a list of public keys.
Expand Down
4 changes: 2 additions & 2 deletions wallet/keys/publicKey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package keys

import (
"encoding/hex"
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestString(t *testing.T) {
Expand All @@ -25,7 +26,6 @@ func TestCreateMultiSigRedeemScript(t *testing.T) {
privateKey3, _ := hex.DecodeString(KeyCases[2].PrivateKey)
privateKey4, _ := hex.DecodeString(KeyCases[3].PrivateKey)


keyPair1, _ := NewKeyPair(privateKey1)
keyPair2, _ := NewKeyPair(privateKey2)
keyPair3, _ := NewKeyPair(privateKey3)
Expand Down
3 changes: 2 additions & 1 deletion wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package wallet
import (
"encoding/json"
"fmt"
"github.com/joeqian10/neo-gogogo/wallet/keys"
"os"

"github.com/joeqian10/neo-gogogo/wallet/keys"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions wallet/walletHelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package wallet

import (
"fmt"
"math/big"
"strconv"

"github.com/joeqian10/neo-gogogo/helper"
"github.com/joeqian10/neo-gogogo/sc"
"github.com/joeqian10/neo-gogogo/tx"
"math/big"
"strconv"
)

type WalletHelper struct {
Expand Down
8 changes: 5 additions & 3 deletions wallet/walletHelper_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package wallet

import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"

"github.com/joeqian10/neo-gogogo/helper"
"github.com/joeqian10/neo-gogogo/rpc"
"github.com/joeqian10/neo-gogogo/rpc/models"
"github.com/joeqian10/neo-gogogo/tx"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"testing"
)

func TestNewWalletHelper(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions wallet/wallet_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package wallet

import (
"github.com/joeqian10/neo-gogogo/wallet/keys"
"github.com/stretchr/testify/assert"
"io/ioutil"
"testing"

"github.com/stretchr/testify/assert"

"github.com/joeqian10/neo-gogogo/wallet/keys"
)

func TestNewWalletFromFile(t *testing.T) {
Expand Down
Loading