Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerd77 committed Aug 7, 2024
1 parent 484a859 commit 69f387e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/evm/src/precompiles/bn254/noble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { bn254 } from '@noble/curves/bn254'
import type { EVMBN254Interface } from '../../types.js'
import type { AffinePoint } from '@noble/curves/abstract/weierstrass'

const BN254_G1_INFINITY_POINT_BYTES = new Uint8Array(32)
const BN254_G1_INFINITY_POINT_BYTES = new Uint8Array(64)

/**
* Converts an Uint8Array to a Noble G1 point.
Expand Down Expand Up @@ -41,7 +41,7 @@ function toG1Point(input: Uint8Array) {

function toFrPoint(input: Uint8Array): bigint {
const Fr = bn254.fields.Fr.fromBytes(input)
if (Fr > bn254.fields.Fr.ORDER) {
if (Fr >= bn254.fields.Fr.ORDER) {
return Fr % bn254.fields.Fr.ORDER
}
return Fr
Expand Down

0 comments on commit 69f387e

Please sign in to comment.