mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
crypto: Created SignatureLength constant
This commit is contained in:
parent
fe86a707d8
commit
00e2b10105
1 changed files with 9 additions and 0 deletions
|
|
@ -34,6 +34,15 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//SignatureLength indicates the byte length required to carry a signature with recovery id.
|
||||||
|
const SignatureLength = 64 + 1 // 64 bytes ECDSA signature + 1 byte recovery id
|
||||||
|
|
||||||
|
// RecoveryIDOffset points to the byte offset within the signature that contains the recovery id.
|
||||||
|
const RecoveryIDOffset = 64
|
||||||
|
|
||||||
|
// DigestLength sets the signature digest exact length
|
||||||
|
const DigestLength = 32
|
||||||
|
|
||||||
var (
|
var (
|
||||||
secp256k1N, _ = new(big.Int).SetString("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16)
|
secp256k1N, _ = new(big.Int).SetString("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16)
|
||||||
secp256k1halfN = new(big.Int).Div(secp256k1N, big.NewInt(2))
|
secp256k1halfN = new(big.Int).Div(secp256k1N, big.NewInt(2))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue