From 2f98aee459d883e1d9b7aada0f2c8d8f428a611c Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Tue, 17 Jun 2025 15:14:07 +0200 Subject: [PATCH] remove optimization --- crypto/bn256/gnark/g1.go | 5 ----- crypto/bn256/gnark/g2.go | 6 ------ 2 files changed, 11 deletions(-) diff --git a/crypto/bn256/gnark/g1.go b/crypto/bn256/gnark/g1.go index 50c25212bf..d6902ab322 100644 --- a/crypto/bn256/gnark/g1.go +++ b/crypto/bn256/gnark/g1.go @@ -78,11 +78,6 @@ func (g *G1) Unmarshal(buf []byte) (int, error) { func (p *G1) Marshal() []byte { output := make([]byte, 64) - // Handle point at infinity - if p.inner.X.IsZero() && p.inner.Y.IsZero() { - return output - } - xBytes := p.inner.X.Bytes() copy(output[:32], xBytes[:]) diff --git a/crypto/bn256/gnark/g2.go b/crypto/bn256/gnark/g2.go index 83a33c112a..619660f771 100644 --- a/crypto/bn256/gnark/g2.go +++ b/crypto/bn256/gnark/g2.go @@ -77,12 +77,6 @@ func (g *G2) Unmarshal(buf []byte) (int, error) { func (g *G2) Marshal() []byte { 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() copy(output[:32], xA0Bytes[:])