crypto/ecpoint: remove legacy SubPoint func

This commit is contained in:
Luke Plaster
2020-07-13 16:36:20 +01:00
committed by creamwhip
parent eafa3ee947
commit 6187032114
2 changed files with 1 additions and 24 deletions

View File

@@ -73,29 +73,6 @@ func (p *ECPoint) Sub(b *ECPoint) (*ECPoint, error) {
return p.Add(b.Neg())
}
func (p *ECPoint) SubPoint(other *ECPoint) (*ECPoint, error) {
order := p.curve.Params().P
modP := common.ModInt(order)
x, y := other.X(), other.Y()
minusY := modP.Sub(order, y)
xVec := x.Bytes()
yVec := minusY.Bytes()
tmpX := make([]byte, 32-len(xVec), 32)
tmpX = append(tmpX, xVec...)
if len(tmpX) != 32 {
return nil, errors.New("SubPoint(): len(tmpX) != 32")
}
xVec = tmpX
tmpY := make([]byte, 32-len(yVec), 32)
tmpY = append(tmpY, yVec...)
if len(tmpY) != 32 {
return nil, errors.New("SubPoint(): len(tmpY) != 32")
}
yVec = tmpY
minusPoint := NewECPointNoCurveCheck(p.curve, new(big.Int).SetBytes(xVec), new(big.Int).SetBytes(yVec))
return p.Add(minusPoint)
}
func (p *ECPoint) Neg() *ECPoint {
order := p.curve.Params().P
negY := new(big.Int).Neg(p.Y())

View File

@@ -261,7 +261,7 @@ func (round *finalization) Start() *tss.Error {
continue
}
gWJKI := round.temp.bigWs[j].ScalarMultBytes(kIs[i])
gNus[i][j], _ = gWJKI.SubPoint(gMus[i][j])
gNus[i][j], _ = gWJKI.Sub(gMus[i][j])
}
}
// compute g^sigma_i's