From b3e47410c94916347b9a660c558ba119857cbad0 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Fri, 15 Mar 2024 12:20:24 +0100 Subject: [PATCH] crypto: do not check if point is on curve during marshalling --- crypto/signature_nocgo.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/crypto/signature_nocgo.go b/crypto/signature_nocgo.go index 84f31bdf56..531031c8bc 100644 --- a/crypto/signature_nocgo.go +++ b/crypto/signature_nocgo.go @@ -178,14 +178,7 @@ func (curve KoblitzCurve) Unmarshal(data []byte) (x, y *big.Int) { if data[0] != 4 { // uncompressed form return nil, nil } - p := curve.Params().P x = new(big.Int).SetBytes(data[1 : 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 }