forked from cerc-io/laconicd-deprecated
@@ -194,7 +194,7 @@ func (pubKey *PubKey) UnmarshalAminoJSON(bz []byte) error {
|
||||
// prior to verification.
|
||||
//
|
||||
// CONTRACT: The signature should be in [R || S] format.
|
||||
func (pubKey PubKey) VerifySignature(msg []byte, sig []byte) bool {
|
||||
func (pubKey PubKey) VerifySignature(msg, sig []byte) bool {
|
||||
if len(sig) == crypto.SignatureLength {
|
||||
// remove recovery ID (V) if contained in the signature
|
||||
sig = sig[:len(sig)-1]
|
||||
|
||||
@@ -38,7 +38,6 @@ func EthSecp256k1Option() keyring.Option {
|
||||
options.SupportedAlgos = SupportedAlgorithms
|
||||
options.SupportedAlgosLedger = SupportedAlgorithmsLedger
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -48,8 +47,7 @@ var (
|
||||
EthSecp256k1 = ethSecp256k1Algo{}
|
||||
)
|
||||
|
||||
type ethSecp256k1Algo struct {
|
||||
}
|
||||
type ethSecp256k1Algo struct{}
|
||||
|
||||
// Name returns eth_secp256k1
|
||||
func (s ethSecp256k1Algo) Name() hd.PubKeyType {
|
||||
@@ -58,7 +56,7 @@ func (s ethSecp256k1Algo) Name() hd.PubKeyType {
|
||||
|
||||
// Derive derives and returns the eth_secp256k1 private key for the given mnemonic and HD path.
|
||||
func (s ethSecp256k1Algo) Derive() hd.DeriveFn {
|
||||
return func(mnemonic string, bip39Passphrase, path string) ([]byte, error) {
|
||||
return func(mnemonic, bip39Passphrase, path string) ([]byte, error) {
|
||||
hdpath, err := accounts.ParseDerivationPath(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -97,7 +95,7 @@ func (s ethSecp256k1Algo) Derive() hd.DeriveFn {
|
||||
// Generate generates a eth_secp256k1 private key from the given bytes.
|
||||
func (s ethSecp256k1Algo) Generate() hd.GenerateFn {
|
||||
return func(bz []byte) cryptotypes.PrivKey {
|
||||
var bzArr = make([]byte, ethsecp256k1.PrivKeySize)
|
||||
bzArr := make([]byte, ethsecp256k1.PrivKeySize)
|
||||
copy(bzArr, bz)
|
||||
|
||||
return ðsecp256k1.PrivKey{Key: bzArr}
|
||||
|
||||
Reference in New Issue
Block a user