Skip to content

Commit

Permalink
Use curve params instead of hardcoded 32 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
obscuren committed Jan 22, 2015
1 parent d4cc2d3 commit 0dfe511
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func Sign(hash []byte, prv *ecdsa.PrivateKey) (sig []byte, err error) {
return nil, fmt.Errorf("hash is required to be exactly 32 bytes (%d)", len(hash))
}

sig, err = secp256k1.Sign(hash, ethutil.LeftPadBytes(prv.D.Bytes(), 32))
sig, err = secp256k1.Sign(hash, ethutil.LeftPadBytes(prv.D.Bytes(), prv.Params().BitSize/8))
return
}

Expand Down

0 comments on commit 0dfe511

Please sign in to comment.