Skip to content

Commit 5cda523

Browse files
committed
BLS fix: don't return 1 because of infinity point (#8277)
1 parent 67c1cb4 commit 5cda523

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/Nethermind/Nethermind.Evm/Precompiles/Bls/PairingCheckPrecompile.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ private PairingCheckPrecompile() { }
4646
var acc = GT.One(buf.AsSpan());
4747
GT p = new(buf.AsSpan()[GT.Sz..]);
4848

49-
bool hasInf = false;
5049
for (int i = 0; i < inputData.Length / PairSize; i++)
5150
{
5251
int offset = i * PairSize;
@@ -62,17 +61,15 @@ private PairingCheckPrecompile() { }
6261
// x == inf || y == inf -> e(x, y) = 1
6362
if (x.IsInf() || y.IsInf())
6463
{
65-
hasInf = true;
6664
continue;
6765
}
6866

6967
p.MillerLoop(y, x);
7068
acc.Mul(p);
7169
}
7270

73-
bool verified = hasInf || acc.FinalExp().IsOne();
7471
byte[] res = new byte[32];
75-
if (verified)
72+
if (acc.FinalExp().IsOne())
7673
{
7774
res[31] = 1;
7875
}

0 commit comments

Comments
 (0)