Update dependencies and refactor p256k crypto package
- Bumped version of lol.mleku.dev from v1.0.4 to v1.0.5. - Added new dependencies: p256k1.mleku.dev and several indirect dependencies for improved cryptographic functionality. - Refactored p256k package to utilize p256k1.mleku.dev/signer for signature operations, replacing the previous btcec implementation. - Removed the secp256k1.go file, consolidating the crypto logic under the new p256k1 library. - Updated documentation to reflect changes in the signer interface and usage.
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"lol.mleku.dev/chk"
|
||||
"next.orly.dev/pkg/encoders/hex"
|
||||
"next.orly.dev/pkg/interfaces/signer"
|
||||
p256k1signer "p256k1.mleku.dev/signer"
|
||||
)
|
||||
|
||||
func NewSecFromHex[V []byte | string](skh V) (sign signer.I, err error) {
|
||||
@@ -13,7 +14,7 @@ func NewSecFromHex[V []byte | string](skh V) (sign signer.I, err error) {
|
||||
if _, err = hex.DecBytes(sk, []byte(skh)); chk.E(err) {
|
||||
return
|
||||
}
|
||||
sign = &Signer{}
|
||||
sign = p256k1signer.NewP256K1Signer()
|
||||
if err = sign.InitSec(sk); chk.E(err) {
|
||||
return
|
||||
}
|
||||
@@ -25,7 +26,7 @@ func NewPubFromHex[V []byte | string](pkh V) (sign signer.I, err error) {
|
||||
if _, err = hex.DecBytes(pk, []byte(pkh)); chk.E(err) {
|
||||
return
|
||||
}
|
||||
sign = &Signer{}
|
||||
sign = p256k1signer.NewP256K1Signer()
|
||||
if err = sign.InitPub(pk); chk.E(err) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user