Skip to content
This repository was archived by the owner on Dec 27, 2023. It is now read-only.
This repository was archived by the owner on Dec 27, 2023. It is now read-only.

Affine(p *PointG1) changes the underlying PointG1 #37

@AnomalRoil

Description

@AnomalRoil

Currently, the Affine function is calling g.affine(p, p):

bls12-381/g1.go

Lines 336 to 338 in 3a0f255

func (g *G1) Affine(p *PointG1) *PointG1 {
return g.affine(p, p)
}

But then it changes the underlying point p, because of this Set:

bls12-381/g1.go

Lines 352 to 355 in 3a0f255

} else {
r.Set(p)
}
return r

This is unexpected from a function that's supposed to return an affine representation, since it actually mutates the point (and can cause nasty race conditions in code assuming the Affine is really just a getter and not a setter.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions