From c8d92ec016c8d9a3de60f278ccc1d7372c5cc8e4 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Tue, 17 Jun 2025 15:56:56 +0200 Subject: [PATCH] appease felix, hes right next to me --- crypto/bn256/gnark/g1.go | 5 ++--- crypto/bn256/gnark/g2.go | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/crypto/bn256/gnark/g1.go b/crypto/bn256/gnark/g1.go index a4cd9bbd16..59e04cb247 100644 --- a/crypto/bn256/gnark/g1.go +++ b/crypto/bn256/gnark/g1.go @@ -43,9 +43,8 @@ func (g *G1) Unmarshal(buf []byte) (int, error) { return 0, errors.New("invalid G1 point size") } - // Check if both coordinates are zero (point at infinity) - isZero := allZeroes(buf[0:64]) - if isZero { + if allZeroes(buf[:64]) { + // point at infinity g.inner.X.SetZero() g.inner.Y.SetZero() return 64, nil diff --git a/crypto/bn256/gnark/g2.go b/crypto/bn256/gnark/g2.go index ad91c06515..07452cc2d8 100644 --- a/crypto/bn256/gnark/g2.go +++ b/crypto/bn256/gnark/g2.go @@ -31,8 +31,7 @@ func (g *G2) Unmarshal(buf []byte) (int, error) { return 0, errors.New("invalid G2 point size") } - isZero := allZeroes(buf[0:128]) - if isZero { + if allZeroes(buf[:128]) { // point at infinity g.inner.X.A0.SetZero() g.inner.X.A1.SetZero()