remove optimization

This commit is contained in:
Kevaundray Wedderburn 2025-06-17 15:14:07 +02:00
parent 103d398e48
commit 2f98aee459
2 changed files with 0 additions and 11 deletions

View file

@ -78,11 +78,6 @@ func (g *G1) Unmarshal(buf []byte) (int, error) {
func (p *G1) Marshal() []byte { func (p *G1) Marshal() []byte {
output := make([]byte, 64) output := make([]byte, 64)
// Handle point at infinity
if p.inner.X.IsZero() && p.inner.Y.IsZero() {
return output
}
xBytes := p.inner.X.Bytes() xBytes := p.inner.X.Bytes()
copy(output[:32], xBytes[:]) copy(output[:32], xBytes[:])

View file

@ -77,12 +77,6 @@ func (g *G2) Unmarshal(buf []byte) (int, error) {
func (g *G2) Marshal() []byte { func (g *G2) Marshal() []byte {
output := make([]byte, 128) output := make([]byte, 128)
// Handle point at infinity
if g.inner.X.A0.IsZero() && g.inner.X.A1.IsZero() &&
g.inner.Y.A0.IsZero() && g.inner.Y.A1.IsZero() {
return output
}
xA0Bytes := g.inner.X.A0.Bytes() xA0Bytes := g.inner.X.A0.Bytes()
copy(output[:32], xA0Bytes[:]) copy(output[:32], xA0Bytes[:])