Skip to content

Commit

Permalink
Merge pull request #5068 from filecoin-project/zen/ledger-sign-print
Browse files Browse the repository at this point in the history
Ledger signature verification
  • Loading branch information
magik6k authored Dec 1, 2020
2 parents 3e143ca + 2e5843a commit 2be9836
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/lotus-shed/ledger.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/urfave/cli/v2"
ledgerfil "github.com/whyrusleeping/ledger-filecoin-go"

Expand Down Expand Up @@ -242,13 +243,16 @@ var ledgerSignTestCmd = &cli.Command{
if err != nil {
return err
}
fmt.Printf("Message: %x\n", b.RawData())

sig, err := fl.SignSECP256K1(p, b.RawData())
if err != nil {
return err
}

fmt.Println(sig.SignatureBytes())
sigBytes := append([]byte{byte(crypto.SigTypeSecp256k1)}, sig.SignatureBytes()...)

fmt.Printf("Signature: %x\n", sigBytes)

return nil
},
Expand Down

0 comments on commit 2be9836

Please sign in to comment.