Browse Source

review comment: cleaner constant for N/2, delete secp256k1N and use (#3279)

`secp256k1.S256().N` directly instead
pull/3284/head
Ismail Khoffi 6 years ago
committed by Ethan Buchman
parent
commit
c1f7399a86
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      crypto/secp256k1/secp256k1_nocgo.go

+ 1
- 2
crypto/secp256k1/secp256k1_nocgo.go View File

@ -14,8 +14,7 @@ import (
// see:
// - https://github.com/ethereum/go-ethereum/blob/f9401ae011ddf7f8d2d95020b7446c17f8d98dc1/crypto/signature_nocgo.go#L90-L93
// - https://github.com/ethereum/go-ethereum/blob/f9401ae011ddf7f8d2d95020b7446c17f8d98dc1/crypto/crypto.go#L39
var secp256k1N, _ = new(big.Int).SetString("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16)
var secp256k1halfN = new(big.Int).Div(secp256k1N, big.NewInt(2))
var secp256k1halfN = new(big.Int).Rsh(secp256k1.S256().N, 1)
// Sign creates an ECDSA signature on curve Secp256k1, using SHA256 on the msg.
// The returned signature will be of the form R || S (in lower-S form).


Loading…
Cancel
Save