Skip to content

chore: fix g2 test failing on merge-train#22920

Merged
ludamad merged 1 commit into
merge-train/barretenbergfrom
si/fix-g2-test
May 4, 2026
Merged

chore: fix g2 test failing on merge-train#22920
ludamad merged 1 commit into
merge-train/barretenbergfrom
si/fix-g2-test

Conversation

@iakovenkos

@iakovenkos iakovenkos commented May 4, 2026

Copy link
Copy Markdown
Contributor

2.IsInPrimeSubgroupRejectsCofactorPoint used a hardcoded BN254 G2 cofactor point encoded as raw native Montgomery limbs. That works in the native build, but WASM uses a different internal Montgomery representation, so the same raw limbs decoded to a different point. In WASM, the fixture was not even on-curve, so the test failed at:

ASSERT_TRUE(off_subgroup.on_curve())

The fix is to express the point using canonical field coordinates instead of backend-specific Montgomery limbs:

fq2{ fq(2), fq(1) }
fq2{ fq("0x101f...01ce"), fq("0x2b76...5fde") }

@iakovenkos iakovenkos self-assigned this May 4, 2026
@iakovenkos iakovenkos requested review from ledwards2225 May 4, 2026 08:36
@ludamad ludamad merged commit bb09709 into merge-train/barretenberg May 4, 2026
15 checks passed
@ludamad ludamad deleted the si/fix-g2-test branch May 4, 2026 11:33
danielntmd pushed a commit to danielntmd/aztec-packages that referenced this pull request May 6, 2026
BEGIN_COMMIT_OVERRIDE
fix(ci): default S3_BUILD_CACHE_AWS_PARAMS in cache_s3_transfer{,_to}
(AztecProtocol#22898)
chore: low-hanging chonk prover fixes from profiling (AztecProtocol#22855)
chore: fuse N `add_scaled` into one `parallel_for` (AztecProtocol#22893)
feat: Delayed merge implementation (AztecProtocol#22775)
chore: numeric audit response (AztecProtocol#22856)
fix: harden BN254 G2 SRS ingress (AztecProtocol#22858)
fix: remove unused hash_challenge variable in batch_merge.test.cpp
(AztecProtocol#22906)
fix(bbup): remove jq dependency (AztecProtocol#22912)
chore: fix g2 test failing on merge-train (AztecProtocol#22920)
fix(ci): error on disabled-cache in CI hash calculation (AztecProtocol#22904)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants