Skip to content

Commit

Permalink
secp256k1 updated to v4 (#256)
Browse files Browse the repository at this point in the history
* secp256k1 updated to v4

* Curve name changed as per azure

* secp256k1 updated to v4

* Curve name changed as per azure

Co-authored-by: AbineshECAD <abinesh@ecadlabs.com>
  • Loading branch information
e-asphyx and AbineshECAD authored Nov 17, 2022
1 parent d900ee2 commit cd47445
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
cloud.google.com/go/kms v1.3.0
github.com/certusone/yubihsm-go v0.1.1-0.20190828101841-d0ca2ed0df7b
github.com/decred/dcrd/dcrec/secp256k1 v1.0.3
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/go-playground/validator/v10 v10.7.0
github.com/google/tink/go v1.6.1
Expand Down Expand Up @@ -35,7 +35,6 @@ require (
github.com/aws/aws-sdk-go v1.43.0
github.com/beorn7/perks v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 // indirect
github.com/enceve/crypto v0.0.0-20160707101852-34d48bb93815 // indirect
github.com/go-playground/locales v0.13.0 // indirect
github.com/go-playground/universal-translator v0.17.0 // indirect
Expand Down
10 changes: 2 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,8 @@ github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwc
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/chaincfg/chainhash v1.0.2 h1:rt5Vlq/jM3ZawwiacWjPa+smINyLRN07EO0cNBV6DGU=
github.com/decred/dcrd/chaincfg/chainhash v1.0.2/go.mod h1:BpbrGgrPTr3YJYRN3Bm+D9NuaFd+zGyNeIKgrhCXK60=
github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=
github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
github.com/decred/dcrd/dcrec/secp256k1 v1.0.3 h1:u4XpHqlscRolxPxt2YHrFBDVZYY1AK+KMV02H1r+HmU=
github.com/decred/dcrd/dcrec/secp256k1 v1.0.3/go.mod h1:eCL8H4MYYjRvsw2TuANvEOcVMFbmi9rt/6hJUWU5wlU=
github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 h1:3GIJYXQDAKpLEFriGFN8SbSffak10UXHGdIcFaMPykY=
github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0/go.mod h1:3s92l0paYkZoIHuj4X93Teg/HB7eGM9x/zokGw+u4mY=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/enceve/crypto v0.0.0-20160707101852-34d48bb93815 h1:D22EM5TeYZJp43hGDx6dUng8mvtyYbB9BnE3+BmJR1Q=
Expand Down
2 changes: 1 addition & 1 deletion pkg/cryptoutils/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"fmt"
"math/big"

"github.com/decred/dcrd/dcrec/secp256k1"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
)

// CanonizeECDSASignature returns the canonical versions of the signature
Expand Down
3 changes: 3 additions & 0 deletions pkg/vault/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ func (v *Vault) Import(ctx context.Context, pk cryptoutils.PrivateKey, opt utils
Key: key,
Hsm: true,
}
if req.Key.Curve == "secp256k1" {
req.Key.Curve = "P-256K"
}

r, err := json.Marshal(&req)
if err != nil {
Expand Down

0 comments on commit cd47445

Please sign in to comment.