crypto/bn256: fix MulScalar (#30974)

The `a` parameter should be used in the `MulScalar` function. The
upstream cloudflare and google repos have already merged fixes.

Reference:
*
8d7daa0c54
* https://github.com/cloudflare/bn256/pull/33
This commit is contained in:
gitglorythegreat 2025-01-02 21:04:06 +08:00 committed by GitHub
parent f4e8e877f6
commit 0feb999d3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -105,8 +105,8 @@ func (e *gfP12) Mul(a, b *gfP12) *gfP12 {
}
func (e *gfP12) MulScalar(a *gfP12, b *gfP6) *gfP12 {
e.x.Mul(&e.x, b)
e.y.Mul(&e.y, b)
e.x.Mul(&a.x, b)
e.y.Mul(&a.y, b)
return e
}

View File

@ -125,8 +125,8 @@ func (e *gfP12) Mul(a, b *gfP12, pool *bnPool) *gfP12 {
}
func (e *gfP12) MulScalar(a *gfP12, b *gfP6, pool *bnPool) *gfP12 {
e.x.Mul(e.x, b, pool)
e.y.Mul(e.y, b, pool)
e.x.Mul(a.x, b, pool)
e.y.Mul(a.y, b, pool)
return e
}