mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
crypto: do not check if point is on curve during marshalling
This commit is contained in:
parent
bbae80ae76
commit
b3e47410c9
1 changed files with 0 additions and 7 deletions
|
|
@ -178,14 +178,7 @@ func (curve KoblitzCurve) Unmarshal(data []byte) (x, y *big.Int) {
|
||||||
if data[0] != 4 { // uncompressed form
|
if data[0] != 4 { // uncompressed form
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
p := curve.Params().P
|
|
||||||
x = new(big.Int).SetBytes(data[1 : 1+byteLen])
|
x = new(big.Int).SetBytes(data[1 : 1+byteLen])
|
||||||
y = new(big.Int).SetBytes(data[1+byteLen:])
|
y = new(big.Int).SetBytes(data[1+byteLen:])
|
||||||
if x.Cmp(p) >= 0 || y.Cmp(p) >= 0 {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
if !curve.IsOnCurve(x, y) {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue